Documentation
¶
Overview ¶
Package memory implements storage interfaces for bolt key-value store database.
Index ¶
- type DevicesStorage
- func (s *DevicesStorage) All(ctx context.Context) ([]models.Device, error)
- func (d *DevicesStorage) New(ctx context.Context, userID int, newDevice models.Device) (int, error)
- func (d *DevicesStorage) OfUser(ctx context.Context, userID int) ([]models.Device, error)
- func (s *DevicesStorage) Read(ctx context.Context, id int) (*models.Device, error)
- func (s *DevicesStorage) Remove(ctx context.Context, id int) error
- func (s *DevicesStorage) Update(ctx context.Context, d models.Device) error
- type Factory
- type UsersStorage
- func (s *UsersStorage) All(ctx context.Context) ([]models.User, error)
- func (s *UsersStorage) New(ctx context.Context, newUser models.User) (int, error)
- func (s *UsersStorage) Read(ctx context.Context, id int) (*models.User, error)
- func (s *UsersStorage) Remove(ctx context.Context, id int) 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 DevicesStorage ¶
type DevicesStorage struct {
// contains filtered or unexported fields
}
DevicesStorage implements storage.Devices interface for bolt database.
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory implements storage.Factory interface for bolt database.
func (Factory) Devices ¶
func (f Factory) Devices() *DevicesStorage
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 bolt database.
func (*UsersStorage) Remove ¶
func (s *UsersStorage) Remove(ctx context.Context, id int) 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.