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 string, newDevice models.Device) (string, error)
- func (d *DevicesStorage) NewByOwner(ctx context.Context, deviceOwner string, newDevice models.Device) (string, error)
- func (d *DevicesStorage) OfUser(ctx context.Context, userID string) ([]models.Device, error)
- func (s *DevicesStorage) Read(ctx context.Context, id string) (*models.Device, error)
- func (s *DevicesStorage) Remove(ctx context.Context, id string) error
- func (s *DevicesStorage) Update(ctx context.Context, d models.Device) error
- type Factory
- type StatusStorageTx
- type TwoFactorStorage
- type UsersStorage
- func (s *UsersStorage) All(ctx context.Context) ([]storage.UserEntry, error)
- func (s *UsersStorage) New(ctx context.Context, newUser storage.UserEntry) (string, error)
- func (s *UsersStorage) Read(ctx context.Context, id string) (*storage.UserEntry, error)
- func (s *UsersStorage) Remove(ctx context.Context, id string) error
- func (s *UsersStorage) Update(ctx context.Context, id string, f func(*storage.UserEntry) error) 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.
func (*DevicesStorage) New ¶
func (d *DevicesStorage) New(ctx context.Context, userID string, newDevice models.Device) (string, error)
New stores given devices data in database and returns new device (given in new model) id.
func (*DevicesStorage) NewByOwner ¶ added in v0.3.1
func (d *DevicesStorage) NewByOwner(ctx context.Context, deviceOwner string, newDevice models.Device) (string, error)
NewByOwner stores given devices (owned by user with given nickname) data in database and returns its id.
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory implements storage.Factory interface for bolt database.
func (Factory) StatusTx ¶ added in v0.3.2
func (f Factory) StatusTx() *StatusStorageTx
StatusTx returns storage interface for reading and writing information about numbers of online users and unkown devices.
type StatusStorageTx ¶ added in v0.3.2
type StatusStorageTx struct {
// contains filtered or unexported fields
}
StatusStorageTx implements storage.StatusTx interface.
type TwoFactorStorage ¶ added in v0.4.0
type TwoFactorStorage struct {
// contains filtered or unexported fields
}
TwoFactorStorage implements TwoFactor storage interface for bolt database.
func (*TwoFactorStorage) Get ¶ added in v0.4.0
Get returns two factor methods for user with given user ID.
type UsersStorage ¶
type UsersStorage struct {
// contains filtered or unexported fields
}
UsersStorage implements storage.Users interface for bolt database.