Documentation
¶
Index ¶
- type CommentStore
- func (s *CommentStore) Delete(id int64) error
- func (s *CommentStore) Get(id int64) (*store.Comment, error)
- func (s *CommentStore) GetByTopic(topicID int64, offset, limit int) ([]*store.Comment, int, error)
- func (s *CommentStore) New(topicID int64, authorID int64, content string) (int64, error)
- func (s *CommentStore) SetContent(id int64, content string) error
- type Store
- type TopicStore
- func (s *TopicStore) Delete(id int64) error
- func (s *TopicStore) Get(id int64) (*store.Topic, error)
- func (s *TopicStore) GetLatest(offset, limit int) ([]*store.Topic, int, error)
- func (s *TopicStore) New(authorID int64, title string) (int64, error)
- func (s *TopicStore) SetTitle(id int64, title string) error
- type UserStore
- func (s *UserStore) Get(id int64) (*store.User, error)
- func (s *UserStore) GetAdmins() ([]*store.User, error)
- func (s *UserStore) GetByAuth(authService string, authID string) (*store.User, error)
- func (s *UserStore) GetByName(name string) (*store.User, error)
- func (s *UserStore) GetMany(ids []int64) (map[int64]*store.User, error)
- func (s *UserStore) New(authService string, authID string) (int64, error)
- func (s *UserStore) SetAdmin(id int64, admin bool) error
- func (s *UserStore) SetAvatar(id int64, avatar string) error
- func (s *UserStore) SetBlocked(id int64, blocked bool) error
- func (s *UserStore) SetName(id int64, name string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommentStore ¶
type CommentStore struct {
OnNew func(topicID int64, authorID int64, content string) (int64, error)
OnGet func(id int64) (*store.Comment, error)
OnGetByTopic func(topicID int64, offset, limit int) ([]*store.Comment, int, error)
OnSetContent func(id int64, content string) error
OnDelete func(id int64) error
}
CommentStore is a mock implementation of store.CommentStore.
func (*CommentStore) Delete ¶
func (s *CommentStore) Delete(id int64) error
func (*CommentStore) GetByTopic ¶
func (*CommentStore) SetContent ¶
func (s *CommentStore) SetContent(id int64, content string) error
type Store ¶
type Store struct {
UserStore *UserStore
TopicStore *TopicStore
CommentStore *CommentStore
}
Store is a mock implementation of store.Store.
func (*Store) Comments ¶
func (s *Store) Comments() store.CommentStore
func (*Store) Topics ¶
func (s *Store) Topics() store.TopicStore
type TopicStore ¶
type TopicStore struct {
OnNew func(authorID int64, title string) (int64, error)
OnGet func(id int64) (*store.Topic, error)
OnGetLatest func(offset, limit int) ([]*store.Topic, int, error)
OnSetTitle func(id int64, title string) error
OnDelete func(id int64) error
}
TopicStore is a mock implementation of store.TopicStore.
func (*TopicStore) Delete ¶
func (s *TopicStore) Delete(id int64) error
type UserStore ¶
type UserStore struct {
OnNew func(authService string, authID string) (int64, error)
OnGet func(id int64) (*store.User, error)
OnGetMany func(ids []int64) (map[int64]*store.User, error)
OnGetAdmins func() ([]*store.User, error)
OnGetByName func(name string) (*store.User, error)
OnGetByAuth func(authService string, authID string) (*store.User, error)
OnSetName func(id int64, name string) error
OnSetBlocked func(id int64, blocked bool) error
OnSetAdmin func(id int64, admin bool) error
OnSetAvatar func(id int64, avatar string) error
}
UserStore is a mock implementation of store.UserStore.
Click to show internal directories.
Click to hide internal directories.