mock

package
v0.0.0-...-97a8b9d Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

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) Get

func (s *CommentStore) Get(id int64) (*store.Comment, error)

func (*CommentStore) GetByTopic

func (s *CommentStore) GetByTopic(topicID int64, offset, limit int) ([]*store.Comment, int, error)

func (*CommentStore) New

func (s *CommentStore) New(topicID int64, authorID int64, content string) (int64, error)

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

func (*Store) Users

func (s *Store) Users() store.UserStore

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

func (*TopicStore) Get

func (s *TopicStore) Get(id int64) (*store.Topic, error)

func (*TopicStore) GetLatest

func (s *TopicStore) GetLatest(offset, limit int) ([]*store.Topic, int, error)

func (*TopicStore) New

func (s *TopicStore) New(authorID int64, title string) (int64, error)

func (*TopicStore) SetTitle

func (s *TopicStore) SetTitle(id int64, title string) 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.

func (*UserStore) Get

func (s *UserStore) Get(id int64) (*store.User, error)

func (*UserStore) GetAdmins

func (s *UserStore) GetAdmins() ([]*store.User, error)

func (*UserStore) GetByAuth

func (s *UserStore) GetByAuth(authService string, authID string) (*store.User, error)

func (*UserStore) GetByName

func (s *UserStore) GetByName(name string) (*store.User, error)

func (*UserStore) GetMany

func (s *UserStore) GetMany(ids []int64) (map[int64]*store.User, error)

func (*UserStore) New

func (s *UserStore) New(authService string, authID string) (int64, error)

func (*UserStore) SetAdmin

func (s *UserStore) SetAdmin(id int64, admin bool) error

func (*UserStore) SetAvatar

func (s *UserStore) SetAvatar(id int64, avatar string) error

func (*UserStore) SetBlocked

func (s *UserStore) SetBlocked(id int64, blocked bool) error

func (*UserStore) SetName

func (s *UserStore) SetName(id int64, name string) error

Jump to

Keyboard shortcuts

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