store

package
v0.1.1-0...-b30295a Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 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
}

ArticleStore struct

func NewArticleStore

func NewArticleStore(db *gorm.DB) *ArticleStore

NewArticleStore func

func (*ArticleStore) AddComment

func (as *ArticleStore) AddComment(a *model.Article, c *model.Comment) error

AddComment func

func (*ArticleStore) AddFavorite

func (as *ArticleStore) AddFavorite(a *model.Article, userID uint) error

AddFavorite func

func (*ArticleStore) CreateArticle

func (as *ArticleStore) CreateArticle(a *model.Article) error

CreateArticle func

func (*ArticleStore) DeleteArticle

func (as *ArticleStore) DeleteArticle(a *model.Article) error

DeleteArticle func

func (*ArticleStore) DeleteComment

func (as *ArticleStore) DeleteComment(c *model.Comment) error

DeleteComment func

func (*ArticleStore) GetBySlug

func (as *ArticleStore) GetBySlug(s string) (*model.Article, error)

GetBySlug func

func (*ArticleStore) GetCommentByID

func (as *ArticleStore) GetCommentByID(id uint) (*model.Comment, error)

GetCommentByID func

func (*ArticleStore) GetCommentsBySlug

func (as *ArticleStore) GetCommentsBySlug(slug string) ([]model.Comment, error)

GetCommentsBySlug func

func (*ArticleStore) GetUserArticleBySlug

func (as *ArticleStore) GetUserArticleBySlug(userID uint, slug string) (*model.Article, error)

GetUserArticleBySlug func

func (*ArticleStore) List

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

List func

func (*ArticleStore) ListByAuthor

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

ListByAuthor func

func (*ArticleStore) ListByTag

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

ListByTag func

func (*ArticleStore) ListByWhoFavorited

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

ListByWhoFavorited func

func (*ArticleStore) ListFeed

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

ListFeed func

func (*ArticleStore) ListTags

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

ListTags func

func (*ArticleStore) RemoveFavorite

func (as *ArticleStore) RemoveFavorite(a *model.Article, userID uint) error

RemoveFavorite func

func (*ArticleStore) UpdateArticle

func (as *ArticleStore) UpdateArticle(a *model.Article, tagList []string) error

UpdateArticle func

func (*ArticleStore) UpdateComment

func (as *ArticleStore) UpdateComment(c *model.Comment) error

UpdateComment func

type UserStore

type UserStore struct {
	// contains filtered or unexported fields
}

UserStore struct

func NewUserStore

func NewUserStore(db *gorm.DB) *UserStore

NewUserStore func

func (*UserStore) AddFollower

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

AddFollower func

func (*UserStore) Create

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

Create func

func (*UserStore) GetByEmail

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

GetByEmail func

func (*UserStore) GetByID

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

GetByID func

func (*UserStore) GetByUsername

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

GetByUsername func

func (*UserStore) IsFollower

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

IsFollower func

func (*UserStore) RemoveFollower

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

RemoveFollower func

func (*UserStore) Update

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

Update func

Jump to

Keyboard shortcuts

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