Documentation ¶
Overview ¶
Package postgres is the Datastore implementation for Postgres
Index ¶
- type DataStore
- func (db *DataStore) ActionCreate(act datastore.Action) (int64, error)
- func (db *DataStore) ActionListForDevice(orgID, deviceID string) ([]datastore.Action, error)
- func (db *DataStore) ActionUpdate(actionID, status, message string) error
- func (db *DataStore) DeviceCreate(device datastore.Device) (int64, error)
- func (db *DataStore) DeviceDelete(deviceID string) error
- func (db *DataStore) DeviceGet(deviceID string) (datastore.Device, error)
- func (db *DataStore) DeviceList(orgID string) ([]datastore.Device, error)
- func (db *DataStore) DevicePing(deviceID string, refresh time.Time) error
- func (db *DataStore) DeviceSnapDelete(id int64) error
- func (db *DataStore) DeviceSnapList(deviceID int64) ([]datastore.DeviceSnap, error)
- func (db *DataStore) DeviceSnapUpsert(ds datastore.DeviceSnap) error
- func (db *DataStore) DeviceVersionDelete(id int64) error
- func (db *DataStore) DeviceVersionGet(deviceID int64) (datastore.DeviceVersion, error)
- func (db *DataStore) DeviceVersionUpsert(dv datastore.DeviceVersion) error
- func (db *DataStore) GroupCreate(orgID, name string) (int64, error)
- func (db *DataStore) GroupGet(orgID, name string) (datastore.Group, error)
- func (db *DataStore) GroupGetDevices(orgID, name string) ([]datastore.Device, error)
- func (db *DataStore) GroupGetExcludedDevices(orgID, name string) ([]datastore.Device, error)
- func (db *DataStore) GroupLinkDevice(orgID, name, deviceID string) error
- func (db *DataStore) GroupList(orgID string) ([]datastore.Group, error)
- func (db *DataStore) GroupUnlinkDevice(orgID, name, deviceID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataStore ¶
DataStore is the postgreSQL implementation of a data store
func OpenDataStore ¶
OpenDataStore returns an open database connection
func (*DataStore) ActionCreate ¶
ActionCreate log an new action
func (*DataStore) ActionListForDevice ¶
ActionListForDevice lists the actions for a device
func (*DataStore) ActionUpdate ¶
ActionUpdate updates an action record
func (*DataStore) DeviceCreate ¶
DeviceCreate adds a new record to device database table, returning the record ID
func (*DataStore) DeviceDelete ¶
DeviceDelete deletes the device
func (*DataStore) DeviceList ¶
DeviceList fetches the devices for an organization from the database
func (*DataStore) DevicePing ¶
DevicePing updates the last ping time from a device
func (*DataStore) DeviceSnapDelete ¶
DeviceSnapDelete removes a snap for a device
func (*DataStore) DeviceSnapList ¶
func (db *DataStore) DeviceSnapList(deviceID int64) ([]datastore.DeviceSnap, error)
DeviceSnapList lists the snaps for a device
func (*DataStore) DeviceSnapUpsert ¶
func (db *DataStore) DeviceSnapUpsert(ds datastore.DeviceSnap) error
DeviceSnapUpsert creates or updates a device snap record
func (*DataStore) DeviceVersionDelete ¶
DeviceVersionDelete removes a device version
func (*DataStore) DeviceVersionGet ¶
func (db *DataStore) DeviceVersionGet(deviceID int64) (datastore.DeviceVersion, error)
DeviceVersionGet fetches a device version details from the database
func (*DataStore) DeviceVersionUpsert ¶
func (db *DataStore) DeviceVersionUpsert(dv datastore.DeviceVersion) error
DeviceVersionUpsert creates or updates a device version record
func (*DataStore) GroupCreate ¶
GroupCreate creates a new group for an organization
func (*DataStore) GroupGetDevices ¶
GroupGetDevices retrieves the devices for a group
func (*DataStore) GroupGetExcludedDevices ¶
GroupGetExcludedDevices retrieves the devices not in a group
func (*DataStore) GroupLinkDevice ¶
GroupLinkDevice links a device to a group
func (*DataStore) GroupUnlinkDevice ¶
GroupUnlinkDevice unlinks a device from a group