Documentation ¶
Index ¶
- type ArticleRepository
- type AuthorRepository
- type Service
- func (a *Service) Delete(ctx context.Context, id int64) (err error)
- func (a *Service) Fetch(ctx context.Context, cursor string, num int64) (res []domain.Article, nextCursor string, err error)
- func (a *Service) GetByID(ctx context.Context, id int64) (res domain.Article, err error)
- func (a *Service) GetByTitle(ctx context.Context, title string) (res domain.Article, err error)
- func (a *Service) Store(ctx context.Context, m *domain.Article) (err error)
- func (a *Service) Update(ctx context.Context, ar *domain.Article) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArticleRepository ¶
type ArticleRepository interface { Fetch(ctx context.Context, cursor string, num int64) (res []domain.Article, nextCursor string, err error) GetByID(ctx context.Context, id int64) (domain.Article, error) GetByTitle(ctx context.Context, title string) (domain.Article, error) Update(ctx context.Context, ar *domain.Article) error Store(ctx context.Context, a *domain.Article) error Delete(ctx context.Context, id int64) error }
ArticleRepository represent the article's repository contract
type AuthorRepository ¶
AuthorRepository represent the author's repository contract
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(a ArticleRepository, ar AuthorRepository) *Service
NewService will create a new article service object
func (*Service) GetByTitle ¶
Click to show internal directories.
Click to hide internal directories.