Documentation ¶
Index ¶
- type DeviceStore
- func (s *DeviceStore) Close() error
- func (s *DeviceStore) CreateDevice(device client.Device) error
- func (s *DeviceStore) DeleteDevice(id string) error
- func (s *DeviceStore) GetDevice(id string) (client.Device, error)
- func (s *DeviceStore) GetDeviceTypes() ([]string, error)
- func (s *DeviceStore) GetDevices() ([]client.Device, error)
- func (s *DeviceStore) GetDevicesByType(deviceType string) ([]client.Device, error)
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeviceStore ¶
type DeviceStore struct {
// contains filtered or unexported fields
}
DeviceStore is a redis implementation of the Store interface
func NewDeviceStore ¶
func NewDeviceStore(conn redis.Conn) *DeviceStore
NewDeviceStore returns a new DeviceStore
func (*DeviceStore) CreateDevice ¶
func (s *DeviceStore) CreateDevice(device client.Device) error
CreateDevice creates a new device in redis
func (*DeviceStore) DeleteDevice ¶
func (s *DeviceStore) DeleteDevice(id string) error
DeleteDevice deletes a device from redis
func (*DeviceStore) GetDevice ¶
func (s *DeviceStore) GetDevice(id string) (client.Device, error)
GetDevice retrieves a device from redis
func (*DeviceStore) GetDeviceTypes ¶
func (s *DeviceStore) GetDeviceTypes() ([]string, error)
GetDeviceTypes retrieves all device types from redis
func (*DeviceStore) GetDevices ¶
func (s *DeviceStore) GetDevices() ([]client.Device, error)
GetDevices retrieves all devices from redis
func (*DeviceStore) GetDevicesByType ¶
func (s *DeviceStore) GetDevicesByType(deviceType string) ([]client.Device, error)
GetDevicesByType retrieves all devices of a given type from redis
type Store ¶
type Store interface { CreateDevice(device client.Device) error GetDevice(id string) (client.Device, error) DeleteDevice(id string) error GetDevicesByType(deviceType string) ([]client.Device, error) GetDevices() ([]client.Device, error) GetDeviceTypes() ([]string, error) Close() error }
Store is an interface for accessing device data that is stored in redis
Click to show internal directories.
Click to hide internal directories.