Documentation ¶
Index ¶
- Variables
- func InitTables(db *gorm.DB) error
- type Article
- type ArticleDAO
- func (d *ArticleDAO) FindAll(ctx context.Context, page, perPage uint) ([]Article, error)
- func (d *ArticleDAO) FindByID(ctx context.Context, id uint) (Article, error)
- func (d *ArticleDAO) Insert(ctx context.Context, article Article) (Article, error)
- func (d *ArticleDAO) Search(ctx context.Context, title, content string) ([]Article, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrArticleDuplicated = errors.New("article already exists") ErrArticleNotFound = errors.New("article not found") )
Functions ¶
func InitTables ¶
Types ¶
type ArticleDAO ¶
type ArticleDAO struct {
// contains filtered or unexported fields
}
func NewArticleDAO ¶
func NewArticleDAO(db *gorm.DB) *ArticleDAO
Click to show internal directories.
Click to hide internal directories.