Documentation ¶
Index ¶
- type Store
- func (mem *Store) ActionCreate(act datastore.Action) (int64, error)
- func (mem *Store) ActionListForDevice(orgID, clientID string) ([]datastore.Action, error)
- func (mem *Store) ActionUpdate(actionID, status, message string) error
- func (mem *Store) DeviceCreate(device datastore.Device) (int64, error)
- func (mem *Store) DeviceGet(id string) (datastore.Device, error)
- func (mem *Store) DeviceList(orgID string) ([]datastore.Device, error)
- func (mem *Store) DevicePing(id string, refresh time.Time) error
- func (mem *Store) DeviceSnapDelete(id int64) error
- func (mem *Store) DeviceSnapList(id int64) ([]datastore.DeviceSnap, error)
- func (mem *Store) DeviceSnapUpsert(ds datastore.DeviceSnap) error
- func (mem *Store) DeviceVersionDelete(id int64) error
- func (mem *Store) DeviceVersionGet(deviceID int64) (datastore.DeviceVersion, error)
- func (mem *Store) DeviceVersionUpsert(dv datastore.DeviceVersion) error
- func (mem *Store) GroupCreate(orgID, name string) (int64, error)
- func (mem *Store) GroupGet(orgID, name string) (datastore.Group, error)
- func (mem *Store) GroupGetDevices(orgID, name string) ([]datastore.Device, error)
- func (mem *Store) GroupGetExcludedDevices(orgID, name string) ([]datastore.Device, error)
- func (mem *Store) GroupLinkDevice(orgID, name, clientID string) error
- func (mem *Store) GroupList(orgID string) ([]datastore.Group, error)
- func (mem *Store) GroupUnlinkDevice(orgID, name, clientID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct { Devices []datastore.Device Snaps []datastore.DeviceSnap Actions []datastore.Action DeviceVersions []datastore.DeviceVersion Groups []datastore.Group GroupLinks []datastore.GroupDeviceLink // contains filtered or unexported fields }
Store implements an in-memory store for testing
func (*Store) ActionCreate ¶
ActionCreate creates an action log
func (*Store) ActionListForDevice ¶
ActionListForDevice fetches the actions for a device
func (*Store) ActionUpdate ¶
ActionUpdate updates an action log
func (*Store) DeviceCreate ¶
DeviceCreate creates a new device
func (*Store) DeviceList ¶
DeviceList fetches existing devices
func (*Store) DevicePing ¶
DevicePing updates a device to indicate its health
func (*Store) DeviceSnapDelete ¶
DeviceSnapDelete deletes the snap records for a device
func (*Store) DeviceSnapList ¶
func (mem *Store) DeviceSnapList(id int64) ([]datastore.DeviceSnap, error)
DeviceSnapList lists the snaps for a device
func (*Store) DeviceSnapUpsert ¶
func (mem *Store) DeviceSnapUpsert(ds datastore.DeviceSnap) error
DeviceSnapUpsert creates or updates a snap for a device
func (*Store) DeviceVersionDelete ¶
DeviceVersionDelete removes a OS record
func (*Store) DeviceVersionGet ¶
func (mem *Store) DeviceVersionGet(deviceID int64) (datastore.DeviceVersion, error)
DeviceVersionGet gets the OS details for a device
func (*Store) DeviceVersionUpsert ¶
func (mem *Store) DeviceVersionUpsert(dv datastore.DeviceVersion) error
DeviceVersionUpsert creates or updates the device OS details
func (*Store) GroupCreate ¶
GroupCreate creates a group record
func (*Store) GroupGetDevices ¶
GroupGetDevices fetches the devices for a group
func (*Store) GroupGetExcludedDevices ¶
GroupGetExcludedDevices fetches the devices not in a group
func (*Store) GroupLinkDevice ¶
GroupLinkDevice links a device with a group
func (*Store) GroupUnlinkDevice ¶
GroupUnlinkDevice unlinks a device from a group