Documentation ¶
Index ¶
- type ArticleRepository
- func (r *ArticleRepository) DeleteArticle(ctx context.Context, slug string) error
- func (r *ArticleRepository) GetArticleBySlug(ctx context.Context, slug string) (*models.Article, error)
- func (r *ArticleRepository) ListArticles(ctx context.Context, author, tag string, limit, offset int64) ([]*models.Article, error)
- func (r *ArticleRepository) UpdateArticle(ctx context.Context, slug string, article *models.Article) error
- func (r *ArticleRepository) WriteArticle(ctx context.Context, article *models.Article) error
- type CommentRepository
- func (r *CommentRepository) DeleteComment(ctx context.Context, ID string) error
- func (r *CommentRepository) GetCommentByID(ctx context.Context, ID string) (*models.Comment, error)
- func (r *CommentRepository) ListComments(ctx context.Context, article string) ([]*models.Comment, error)
- func (r *CommentRepository) WriteComment(ctx context.Context, comment *models.Comment) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArticleRepository ¶
func NewArticleRepository ¶
func NewArticleRepository(client *mongo.Client) *ArticleRepository
func (*ArticleRepository) DeleteArticle ¶
func (r *ArticleRepository) DeleteArticle(ctx context.Context, slug string) error
func (*ArticleRepository) GetArticleBySlug ¶
func (*ArticleRepository) ListArticles ¶
func (*ArticleRepository) UpdateArticle ¶
func (*ArticleRepository) WriteArticle ¶
type CommentRepository ¶
func NewCommentRepository ¶
func NewCommentRepository(client *mongo.Client) *CommentRepository
func (*CommentRepository) DeleteComment ¶
func (r *CommentRepository) DeleteComment(ctx context.Context, ID string) error
func (*CommentRepository) GetCommentByID ¶
func (*CommentRepository) ListComments ¶
func (*CommentRepository) WriteComment ¶
Click to show internal directories.
Click to hide internal directories.