Documentation ¶
Overview ¶
Package mock implements storage interfaces that can be used in unit tests or for running long-season with volatile data storage.
Index ¶
- type Factory
- type UsersStorage
- func (s *UsersStorage) All(ctx context.Context) ([]models.User, error)
- func (s *UsersStorage) New(ctx context.Context, newUser models.User) (string, error)
- func (s *UsersStorage) Read(ctx context.Context, id string) (*models.User, error)
- func (s *UsersStorage) Remove(ctx context.Context, id string) error
- func (s *UsersStorage) Update(ctx context.Context, u models.User) error
- func (s *UsersStorage) UpdateMany(ctx context.Context, u []models.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory returns mock interfaces specific to stored data. Implements storage.Factory interface.
func (Factory) Users ¶
func (f Factory) Users() *UsersStorage
Users returns storage interface for manipulating users data.
type UsersStorage ¶
type UsersStorage struct {
// contains filtered or unexported fields
}
UsersStorage implements storage.Users interface for mocking purposes.
func (*UsersStorage) Remove ¶
func (s *UsersStorage) Remove(ctx context.Context, id string) error
Remove deletes user with given id from storage.
func (*UsersStorage) UpdateMany ¶
UpdateMany overwrites data of all users in given slice.
Click to show internal directories.
Click to hide internal directories.