Documentation ¶
Index ¶
- type ArticleStore
- func (as *ArticleStore) AddComment(a *model.Article, c *model.Comment) error
- func (as *ArticleStore) AddFavorite(a *model.Article, userID uint) error
- func (as *ArticleStore) CreateArticle(a *model.Article) error
- func (as *ArticleStore) DeleteArticle(a *model.Article) error
- func (as *ArticleStore) DeleteComment(c *model.Comment) error
- func (as *ArticleStore) GetBySlug(s string) (*model.Article, error)
- func (as *ArticleStore) GetCommentByID(id uint) (*model.Comment, error)
- func (as *ArticleStore) GetCommentsBySlug(slug string) ([]model.Comment, error)
- func (as *ArticleStore) GetUserArticleBySlug(userID uint, slug string) (*model.Article, error)
- func (as *ArticleStore) List(offset, limit int) ([]model.Article, int, error)
- func (as *ArticleStore) ListByAuthor(username string, offset, limit int) ([]model.Article, int, error)
- func (as *ArticleStore) ListByTag(tag string, offset, limit int) ([]model.Article, int, error)
- func (as *ArticleStore) ListByWhoFavorited(username string, offset, limit int) ([]model.Article, int, error)
- func (as *ArticleStore) ListFeed(userID uint, offset, limit int) ([]model.Article, int, error)
- func (as *ArticleStore) ListTags() ([]model.Tag, error)
- func (as *ArticleStore) RemoveFavorite(a *model.Article, userID uint) error
- func (as *ArticleStore) UpdateArticle(a *model.Article, tagList []string) error
- type UserStore
- func (us *UserStore) AddFollower(u *model.User, followerID uint) error
- func (us *UserStore) Create(u *model.User) (err error)
- func (us *UserStore) GetByEmail(e string) (*model.User, error)
- func (us *UserStore) GetByID(id uint) (*model.User, error)
- func (us *UserStore) GetByUsername(username string) (*model.User, error)
- func (us *UserStore) IsFollower(userID, followerID uint) (bool, error)
- func (us *UserStore) RemoveFollower(u *model.User, followerID uint) error
- func (us *UserStore) Update(u *model.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArticleStore ¶
type ArticleStore struct {
// contains filtered or unexported fields
}
func NewArticleStore ¶
func NewArticleStore(db *gorm.DB) *ArticleStore
func (*ArticleStore) AddComment ¶
func (*ArticleStore) AddFavorite ¶
func (as *ArticleStore) AddFavorite(a *model.Article, userID uint) error
func (*ArticleStore) CreateArticle ¶
func (as *ArticleStore) CreateArticle(a *model.Article) error
func (*ArticleStore) DeleteArticle ¶
func (as *ArticleStore) DeleteArticle(a *model.Article) error
func (*ArticleStore) DeleteComment ¶
func (as *ArticleStore) DeleteComment(c *model.Comment) error
func (*ArticleStore) GetBySlug ¶
func (as *ArticleStore) GetBySlug(s string) (*model.Article, error)
func (*ArticleStore) GetCommentByID ¶
func (as *ArticleStore) GetCommentByID(id uint) (*model.Comment, error)
func (*ArticleStore) GetCommentsBySlug ¶
func (as *ArticleStore) GetCommentsBySlug(slug string) ([]model.Comment, error)
func (*ArticleStore) GetUserArticleBySlug ¶
func (*ArticleStore) ListByAuthor ¶
func (*ArticleStore) ListByWhoFavorited ¶
func (*ArticleStore) RemoveFavorite ¶
func (as *ArticleStore) RemoveFavorite(a *model.Article, userID uint) error
func (*ArticleStore) UpdateArticle ¶
func (as *ArticleStore) UpdateArticle(a *model.Article, tagList []string) error
type UserStore ¶
type UserStore struct {
// contains filtered or unexported fields
}
func NewUserStore ¶
func (*UserStore) AddFollower ¶
func (*UserStore) GetByUsername ¶
func (*UserStore) IsFollower ¶
func (*UserStore) RemoveFollower ¶
Click to show internal directories.
Click to hide internal directories.