repositories

package
v0.0.0-...-9c79e73 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArticleRepository

type ArticleRepository struct {
	DBClient *mongo.Client
}

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 (r *ArticleRepository) GetArticleBySlug(ctx context.Context, slug string) (*models.Article, error)

func (*ArticleRepository) ListArticles

func (r *ArticleRepository) ListArticles(ctx context.Context, author, tag string, limit, offset int64) ([]*models.Article, error)

func (*ArticleRepository) UpdateArticle

func (r *ArticleRepository) UpdateArticle(ctx context.Context, slug string, article *models.Article) error

func (*ArticleRepository) WriteArticle

func (r *ArticleRepository) WriteArticle(ctx context.Context, article *models.Article) error

type CommentRepository

type CommentRepository struct {
	DBClient *mongo.Client
}

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 (r *CommentRepository) GetCommentByID(ctx context.Context, ID string) (*models.Comment, error)

func (*CommentRepository) ListComments

func (r *CommentRepository) ListComments(ctx context.Context, article string) ([]*models.Comment, error)

func (*CommentRepository) WriteComment

func (r *CommentRepository) WriteComment(ctx context.Context, comment *models.Comment) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL