123456789101112131415161718192021222324252627282930 |
- package handler
- //go:generate mkdir -p mocks
- //go:generate rm -rf ./mocks/*_minimock.go
- //go:generate minimock -i CacheService,ArticleRepository,TagRepository -o ./mocks/ -s "_minimock.go"
- import (
- "context"
- "time"
- "git.dmitriygnatenko.ru/dima/dmitriygnatenko-v2/internal/models"
- )
- type (
- CacheService interface {
- Get(key string) (interface{}, bool)
- Set(key string, value interface{}, expiration *time.Duration)
- }
- ArticleRepository interface {
- GetByURL(ctx context.Context, url string) (*models.Article, error)
- GetAllPreview(ctx context.Context, lang models.LanguageID) ([]models.ArticlePreview, error)
- GetPreviewByTagID(ctx context.Context, tagID uint64, lang models.LanguageID) ([]models.ArticlePreview, error)
- }
- TagRepository interface {
- GetAllUsed(ctx context.Context, lang models.LanguageID) ([]models.Tag, error)
- GetByURL(ctx context.Context, tag string) (*models.Tag, error)
- }
- )
|