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)
- type User
- type UserDAO
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrArticleDuplicated = errors.New("article already exists") ErrArticleNotFound = errors.New("article not found") )
View Source
var ( ErrUserEmailExists = errors.New("user already exists") ErrUserNotFound = errors.New("user not found") )
Functions ¶
func InitTables ¶
Types ¶
type ArticleDAO ¶
type ArticleDAO struct {
// contains filtered or unexported fields
}
func NewArticleDAO ¶
func NewArticleDAO(db *gorm.DB) *ArticleDAO
type UserDAO ¶
type UserDAO struct {
// contains filtered or unexported fields
}
func NewUserDAO ¶
func (*UserDAO) FindByEmail ¶
Click to show internal directories.
Click to hide internal directories.