Documentation
¶
Index ¶
- type Article
- type ArticleRepo
- type ArticleUsecase
- func (au *ArticleUsecase) CreateArticle(ctx context.Context, article *Article) (*Article, error)
- func (au *ArticleUsecase) DeleteArticle(ctx context.Context, name string) (*emptypb.Empty, error)
- func (au *ArticleUsecase) GetArticle(ctx context.Context, name string) (*Article, error)
- func (au *ArticleUsecase) ListArticles(ctx context.Context, parent string) (*Articles, error)
- func (au *ArticleUsecase) SearchArticles(ctx context.Context, name string) (*Articles, error)
- func (au *ArticleUsecase) UpdateArticle(ctx context.Context, article *Article) (*Article, error)
- type Articles
- type Attribute
- type AttributeRepo
- type AttributeUsecase
- func (au *AttributeUsecase) CreateAttribute(ctx context.Context, article *Attribute) (*Attribute, error)
- func (au *AttributeUsecase) DeleteAttribute(ctx context.Context, name string) (*emptypb.Empty, error)
- func (au *AttributeUsecase) GetAttribute(ctx context.Context, name string) (*Attribute, error)
- func (au *AttributeUsecase) ListAttributes(ctx context.Context) (*Attributes, error)
- func (au *AttributeUsecase) SearchAttributes(ctx context.Context, name string) (*Attributes, error)
- func (au *AttributeUsecase) UpdateAttribute(ctx context.Context, article *Attribute) (*Attribute, error)
- type Attributes
- type Categories
- type Category
- type CategoryRepo
- type CategoryUsecase
- func (cu *CategoryUsecase) CreateCategory(ctx context.Context, category *Category) (*Category, error)
- func (cu *CategoryUsecase) DeleteCategory(ctx context.Context, name string) (*emptypb.Empty, error)
- func (cu *CategoryUsecase) GetCategory(ctx context.Context, name string) (*Category, error)
- func (cu *CategoryUsecase) ListCategories(ctx context.Context) (*Categories, error)
- func (cu *CategoryUsecase) UpdateCategory(ctx context.Context, category *Category) (*Category, error)
- type Tag
- type TagRepo
- type TagUsecase
- func (tu *TagUsecase) CreateTag(ctx context.Context, tag *Tag) (*Tag, error)
- func (tu *TagUsecase) DeleteTag(ctx context.Context, name string) (*emptypb.Empty, error)
- func (tu *TagUsecase) GetTag(ctx context.Context, name string) (*Tag, error)
- func (tu *TagUsecase) ListTags(ctx context.Context) (*Tags, error)
- func (tu *TagUsecase) UpdateTag(ctx context.Context, tag *Tag) (*Tag, error)
- type Tags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct {
CategoryId, UserId int
ArticleId, Title, Content string
Category *Category
UpdateTime *timestamppb.Timestamp
Tags *Tags
Attributes *Attributes
}
type ArticleRepo ¶
type ArticleRepo interface { ListArticles(ctx context.Context, parent string) (*Articles, error) GetArticle(ctx context.Context, name string) (*Article, error) SearchArticles(ctx context.Context, name string) (*Articles, error) CreateArticle(ctx context.Context, article *Article) (*Article, error) UpdateArticle(ctx context.Context, article *Article) (*Article, error) DeleteArticle(ctx context.Context, name string) (*emptypb.Empty, error) }
type ArticleUsecase ¶
type ArticleUsecase struct {
// contains filtered or unexported fields
}
func NewArticleUsecase ¶
func NewArticleUsecase(repo ArticleRepo, logger log.Logger) *ArticleUsecase
func (*ArticleUsecase) CreateArticle ¶
func (*ArticleUsecase) DeleteArticle ¶
func (*ArticleUsecase) GetArticle ¶
func (*ArticleUsecase) ListArticles ¶
func (*ArticleUsecase) SearchArticles ¶
func (*ArticleUsecase) UpdateArticle ¶
type Attribute ¶
type Attribute struct {
Id, UserId int
Path, Description, ArticleId string
UpdateTime *timestamppb.Timestamp
}
type AttributeRepo ¶
type AttributeRepo interface { ListAttributes(ctx context.Context) (*Attributes, error) GetAttribute(ctx context.Context, name string) (*Attribute, error) SearchAttributes(ctx context.Context, name string) (*Attributes, error) CreateAttribute(ctx context.Context, article *Attribute) (*Attribute, error) UpdateAttribute(ctx context.Context, article *Attribute) (*Attribute, error) DeleteAttribute(ctx context.Context, name string) (*emptypb.Empty, error) }
type AttributeUsecase ¶
type AttributeUsecase struct {
// contains filtered or unexported fields
}
func NewAttributeUsecase ¶
func NewAttributeUsecase(repo AttributeRepo, logger log.Logger) *AttributeUsecase
func (*AttributeUsecase) CreateAttribute ¶
func (*AttributeUsecase) DeleteAttribute ¶
func (*AttributeUsecase) GetAttribute ¶
func (*AttributeUsecase) ListAttributes ¶
func (au *AttributeUsecase) ListAttributes(ctx context.Context) (*Attributes, error)
func (*AttributeUsecase) SearchAttributes ¶
func (au *AttributeUsecase) SearchAttributes(ctx context.Context, name string) (*Attributes, error)
func (*AttributeUsecase) UpdateAttribute ¶
type Attributes ¶
type Categories ¶
type Category ¶
type Category struct { CategoryId int CategoryName, CategoryCode string UpdateTime *timestamppb.Timestamp }
type CategoryRepo ¶
type CategoryRepo interface { ListCategories(ctx context.Context) (*Categories, error) GetCategory(ctx context.Context, name string) (*Category, error) CreateCategory(ctx context.Context, category *Category) (*Category, error) UpdateCategory(ctx context.Context, category *Category) (*Category, error) DeleteCategory(ctx context.Context, name string) (*emptypb.Empty, error) }
type CategoryUsecase ¶
type CategoryUsecase struct {
// contains filtered or unexported fields
}
func NewCategoryUsecase ¶
func NewCategoryUsecase(repo CategoryRepo, logger *log.Logger) *CategoryUsecase
func (*CategoryUsecase) CreateCategory ¶
func (*CategoryUsecase) DeleteCategory ¶
func (*CategoryUsecase) GetCategory ¶
func (*CategoryUsecase) ListCategories ¶
func (cu *CategoryUsecase) ListCategories(ctx context.Context) (*Categories, error)
func (*CategoryUsecase) UpdateCategory ¶
type TagRepo ¶
type TagRepo interface { ListTags(ctx context.Context) (*Tags, error) GetTag(ctx context.Context, name string) (*Tag, error) CreateTag(ctx context.Context, tag *Tag) (*Tag, error) UpdateTag(ctx context.Context, tag *Tag) (*Tag, error) DeleteTag(ctx context.Context, name string) (*emptypb.Empty, error) }
type TagUsecase ¶
type TagUsecase struct {
// contains filtered or unexported fields
}
func NewTagUsecase ¶
func NewTagUsecase(repo TagRepo, logger *log.Logger) *TagUsecase
Click to show internal directories.
Click to hide internal directories.