Forráskód Böngészése

Update interfaces

Dima 1 éve
szülő
commit
4f2dcdddc2

+ 1 - 1
internal/interfaces/cache.go

@@ -1,6 +1,6 @@
 package interfaces
 
-type ICache interface {
+type Cache interface {
 	Get(key string) (interface{}, bool)
 	Set(key string, value interface{})
 	FlushAll()

+ 1 - 1
internal/interfaces/env.go

@@ -1,6 +1,6 @@
 package interfaces
 
-type IEnv interface {
+type Env interface {
 	GetAppPort() string
 	GetDBPort() string
 	GetDBHost() string

+ 1 - 1
internal/interfaces/mailer.go

@@ -1,5 +1,5 @@
 package interfaces
 
-type IMailer interface {
+type Mailer interface {
 	Send(recipient string, subject string, text string) error
 }

+ 3 - 3
internal/interfaces/repository.go

@@ -6,7 +6,7 @@ import (
 	"github.com/dmitriygnatenko/internal/models"
 )
 
-type IArticleRepository interface {
+type ArticleRepository interface {
 	GetAll(ctx context.Context) ([]models.Article, error)
 	GetAllPreview(ctx context.Context) ([]models.ArticlePreview, error)
 	GetPreviewByTagID(ctx context.Context, tagID int) ([]models.ArticlePreview, error)
@@ -17,7 +17,7 @@ type IArticleRepository interface {
 	Delete(ctx context.Context, ID int) error
 }
 
-type ITagRepository interface {
+type TagRepository interface {
 	GetAll(ctx context.Context) ([]models.Tag, error)
 	GetAllUsed(ctx context.Context) ([]models.Tag, error)
 	IsUsed(ctx context.Context, ID int) (bool, error)
@@ -29,7 +29,7 @@ type ITagRepository interface {
 	Delete(ctx context.Context, ID int) error
 }
 
-type IArticleTagRepository interface {
+type ArticleTagRepository interface {
 	Add(ctx context.Context, articleID int, tagIDs []int) error
 	Delete(ctx context.Context, articleID int, tagIDs []int) error
 	DeleteByArticleID(ctx context.Context, articleID int) error

+ 7 - 7
internal/interfaces/sp.go

@@ -1,10 +1,10 @@
 package interfaces
 
-type IServiceProvider interface {
-	GetEnvService() IEnv
-	GetCacheService() ICache
-	GetMailerService() IMailer
-	GetArticleRepository() IArticleRepository
-	GetTagRepository() ITagRepository
-	GetArticleTagRepository() IArticleTagRepository
+type ServiceProvider interface {
+	GetEnvService() Env
+	GetCacheService() Cache
+	GetMailerService() Mailer
+	GetArticleRepository() ArticleRepository
+	GetTagRepository() TagRepository
+	GetArticleTagRepository() ArticleTagRepository
 }