Documentation
¶
Index ¶
- type Db
- func (db *Db) Device(id string) (ret data.Device, err error)
- func (db *Db) DeviceDelete(id string) error
- func (db *Db) DeviceGetCmd(id string) (data.DeviceCmd, error)
- func (db *Db) DeviceSample(id string, sample data.Sample) error
- func (db *Db) DeviceSetCmd(cmd data.DeviceCmd) error
- func (db *Db) DeviceSetVersion(id string, ver data.DeviceVersion) error
- func (db *Db) DeviceUpdate(device data.Device) error
- func (db *Db) DeviceUpdateConfig(id string, config data.DeviceConfig) error
- func (db *Db) Devices() (ret []data.Device, err error)
- type Influx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Db ¶
type Db struct {
// contains filtered or unexported fields
}
Db is used for all db access in the application. We will eventually turn this into an interface to handle multiple Db backends.
func (*Db) DeviceDelete ¶
DeviceDelete deletes a device from the database
func (*Db) DeviceGetCmd ¶
DeviceGetCmd gets a cmd for a device. If the cmd is no null, the command is deleted, and the cmdPending flag cleared in the Device data structure.
func (*Db) DeviceSample ¶
DeviceSample processes a sample for a particular device
func (*Db) DeviceSetCmd ¶
DeviceSetCmd sets a cmd for a device, and sets the CmdPending flag in the device structure.
func (*Db) DeviceSetVersion ¶
func (db *Db) DeviceSetVersion(id string, ver data.DeviceVersion) error
DeviceSetVersion sets a cmd for a device, and sets the CmdPending flag in the device structure.
func (*Db) DeviceUpdate ¶
DeviceUpdate updates a devices state in the database
func (*Db) DeviceUpdateConfig ¶
func (db *Db) DeviceUpdateConfig(id string, config data.DeviceConfig) error
DeviceUpdateConfig updates the config for a particular device