Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientRepository ¶ added in v0.2.0
func NewClientRepository ¶ added in v0.2.0
func NewClientRepository(clientInfo mgrpc.ClientInfo) (ClientRepository, error)
NewClientRepository creates a new client repository.
type Database ¶
type Database interface { AddAuthor(author data.Author) (string, error) ListAll() []data.Author UpdateAuthor(author data.Author) (data.Author, error) DeleteAuthor(id string) error GetAuthor(id string) (data.Author, error) }
func NewInMemoryDatabase ¶ added in v0.2.0
func NewInMemoryDatabase() Database
NewInMemoryDatabase creates a new InMemoryDatabase.
func NewMongoDatabase ¶
func NewMongoDatabase(connection *mdb.MongoConnection) Database
NewMongoDatabase creates a new mongo database.
type FakeClientRepository ¶ added in v0.2.0
type FakeClientRepository struct { ClientRepository // contains filtered or unexported fields }
func NewFakeClientRepository ¶ added in v0.2.0
func NewFakeClientRepository() *FakeClientRepository
func (*FakeClientRepository) DeleteAuthorQuotes ¶ added in v0.2.0
func (f *FakeClientRepository) DeleteAuthorQuotes(_ string) (bool, error)
func (*FakeClientRepository) SetDeleteAuthorQuotesReturn ¶ added in v0.2.0
func (f *FakeClientRepository) SetDeleteAuthorQuotesReturn(ret bool, err error)
type Repository ¶
type Repository interface { AddAuthor(author data.Author) (string, error) ListAll() []data.Author UpdateAuthor(author data.Author) (data.Author, error) DeleteAuthor(id string) error GetAuthor(id string) (data.Author, error) }
Repository represents the repository interface.
func New ¶
func New(db Database, clientRepository ClientRepository) Repository
New creates a new repository.
Click to show internal directories.
Click to hide internal directories.