store

package
v0.0.0-...-53a8d60 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

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 (as *ArticleStore) AddComment(a *model.Article, c *model.Comment) error

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 (as *ArticleStore) GetUserArticleBySlug(userID uint, slug string) (*model.Article, error)

func (*ArticleStore) List

func (as *ArticleStore) List(offset, limit int) ([]model.Article, int, error)

func (*ArticleStore) ListByAuthor

func (as *ArticleStore) ListByAuthor(username string, offset, limit int) ([]model.Article, int, error)

func (*ArticleStore) ListByTag

func (as *ArticleStore) ListByTag(tag string, offset, limit int) ([]model.Article, int, error)

func (*ArticleStore) ListByWhoFavorited

func (as *ArticleStore) ListByWhoFavorited(username string, offset, limit int) ([]model.Article, int, error)

func (*ArticleStore) ListFeed

func (as *ArticleStore) ListFeed(userID uint, offset, limit int) ([]model.Article, int, error)

func (*ArticleStore) ListTags

func (as *ArticleStore) ListTags() ([]model.Tag, error)

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 NewUserStore(db *gorm.DB) *UserStore

func (*UserStore) AddFollower

func (us *UserStore) AddFollower(u *model.User, followerID uint) error

func (*UserStore) Create

func (us *UserStore) Create(u *model.User) (err error)

func (*UserStore) GetByEmail

func (us *UserStore) GetByEmail(e string) (*model.User, error)

func (*UserStore) GetByID

func (us *UserStore) GetByID(id uint) (*model.User, error)

func (*UserStore) GetByUsername

func (us *UserStore) GetByUsername(username string) (*model.User, error)

func (*UserStore) IsFollower

func (us *UserStore) IsFollower(userID, followerID uint) (bool, error)

func (*UserStore) RemoveFollower

func (us *UserStore) RemoveFollower(u *model.User, followerID uint) error

func (*UserStore) Update

func (us *UserStore) Update(u *model.User) error

Jump to

Keyboard shortcuts

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