Documentation ¶
Index ¶
- Variables
- type Article
- type ArticleRepo
- type ArticleUsecase
- func (uc *ArticleUsecase) Create(ctx context.Context, article *Article) (int64, error)
- func (uc *ArticleUsecase) Delete(ctx context.Context, id int64) error
- func (uc *ArticleUsecase) Get(ctx context.Context, id int64) (p *Article, err error)
- func (uc *ArticleUsecase) List(ctx context.Context, uid int64) (ps []*Article, err error)
- func (uc *ArticleUsecase) Update(ctx context.Context, id int64, article *Article) error
Constants ¶
This section is empty.
Variables ¶
View Source
var CacheMissVal = "-"
View Source
var ProviderSet = wire.NewSet(NewArticleUsecase)
ProviderSet is biz providers.
Functions ¶
This section is empty.
Types ¶
type ArticleRepo ¶
type ArticleRepo interface { // db ListArticle(ctx context.Context, uid int64) ([]*Article, error) GetArticle(ctx context.Context, id int64) (*Article, error) CreateArticle(ctx context.Context, article *Article) (int64, error) UpdateArticle(ctx context.Context, id int64, article *Article) error DeleteArticle(ctx context.Context, id int64) error // redis GetArticleCache(ctx context.Context, id int64) (article string, err error) CreateArticleCache(ctx context.Context, id int64, data string) error DeleteArticleCache(ctx context.Context, id int64) error }
type ArticleUsecase ¶
type ArticleUsecase struct {
// contains filtered or unexported fields
}
func NewArticleUsecase ¶
func NewArticleUsecase(repo ArticleRepo, logger log.Logger) *ArticleUsecase
func (*ArticleUsecase) Delete ¶
func (uc *ArticleUsecase) Delete(ctx context.Context, id int64) error
Click to show internal directories.
Click to hide internal directories.