Documentation ¶
Index ¶
- Constants
- func AddDeviceTrans(adds []Device, addAttrs []DeviceAttr, addTwins []DeviceTwin) error
- func DeleteDeviceAttr(obm orm.Ormer, deviceID string, name string) error
- func DeleteDeviceAttrByDeviceID(obm orm.Ormer, deviceID string) error
- func DeleteDeviceByID(obm orm.Ormer, id string) error
- func DeleteDeviceTrans(deletes []string) error
- func DeleteDeviceTwin(obm orm.Ormer, deviceID string, name string) error
- func DeleteDeviceTwinByDeviceID(obm orm.Ormer, deviceID string) error
- func DeviceAttrTrans(adds []DeviceAttr, deletes []DeviceDelete, updates []DeviceAttrUpdate) error
- func DeviceTwinTrans(adds []DeviceTwin, deletes []DeviceDelete, updates []DeviceTwinUpdate) error
- func InitDBTable(module core.Module)
- func QueryDevice(key string, condition string) (*[]Device, error)
- func QueryDeviceAll() (*[]Device, error)
- func QueryDeviceAttr(key string, condition string) (*[]DeviceAttr, error)
- func QueryDeviceTwin(key string, condition string) (*[]DeviceTwin, error)
- func SaveDevice(obm orm.Ormer, doc *Device) error
- func SaveDeviceAttr(obm orm.Ormer, doc *DeviceAttr) error
- func SaveDeviceTwin(obm orm.Ormer, doc *DeviceTwin) error
- func UpdateDeviceAttrField(deviceID string, name string, col string, value interface{}) error
- func UpdateDeviceAttrFields(obm orm.Ormer, deviceID string, name string, cols map[string]interface{}) error
- func UpdateDeviceAttrMulti(updates []DeviceAttrUpdate) error
- func UpdateDeviceField(deviceID string, col string, value interface{}) error
- func UpdateDeviceFields(deviceID string, cols map[string]interface{}) error
- func UpdateDeviceMulti(updates []DeviceUpdate) error
- func UpdateDeviceTwinField(deviceID string, name string, col string, value interface{}) error
- func UpdateDeviceTwinFields(obm orm.Ormer, deviceID string, name string, cols map[string]interface{}) error
- func UpdateDeviceTwinMulti(updates []DeviceTwinUpdate) error
- type Device
- type DeviceAttr
- type DeviceAttrUpdate
- type DeviceDelete
- type DeviceTwin
- type DeviceTwinUpdate
- type DeviceUpdate
Constants ¶
const ( //DeviceTableName device table DeviceTableName = "device" //DeviceAttrTableName device table DeviceAttrTableName = "device_attr" //DeviceTwinTableName device table DeviceTwinTableName = "device_twin" )
Variables ¶
This section is empty.
Functions ¶
func AddDeviceTrans ¶
func AddDeviceTrans(adds []Device, addAttrs []DeviceAttr, addTwins []DeviceTwin) error
AddDeviceTrans the transaction of add device
func DeleteDeviceAttr ¶
DeleteDeviceAttr delete device attr
func DeleteDeviceAttrByDeviceID ¶
DeleteDeviceAttrByDeviceID delete device attr
func DeleteDeviceByID ¶
DeleteDeviceByID delete device by id
func DeleteDeviceTrans ¶
DeleteDeviceTrans the transaction of delete device
func DeleteDeviceTwin ¶
DeleteDeviceTwin delete device twin
func DeleteDeviceTwinByDeviceID ¶
DeleteDeviceTwinByDeviceID delete device twin
func DeviceAttrTrans ¶
func DeviceAttrTrans(adds []DeviceAttr, deletes []DeviceDelete, updates []DeviceAttrUpdate) error
DeviceAttrTrans transaction of device attr
func DeviceTwinTrans ¶
func DeviceTwinTrans(adds []DeviceTwin, deletes []DeviceDelete, updates []DeviceTwinUpdate) error
DeviceTwinTrans transaction of device twin
func QueryDevice ¶
QueryDevice query Device
func QueryDeviceAttr ¶
func QueryDeviceAttr(key string, condition string) (*[]DeviceAttr, error)
QueryDeviceAttr query Device
func QueryDeviceTwin ¶
func QueryDeviceTwin(key string, condition string) (*[]DeviceTwin, error)
QueryDeviceTwin query Device
func SaveDeviceAttr ¶
func SaveDeviceAttr(obm orm.Ormer, doc *DeviceAttr) error
SaveDeviceAttr save device attributes
func SaveDeviceTwin ¶
func SaveDeviceTwin(obm orm.Ormer, doc *DeviceTwin) error
SaveDeviceTwin save device twin
func UpdateDeviceAttrField ¶
UpdateDeviceAttrField update special field
func UpdateDeviceAttrFields ¶
func UpdateDeviceAttrFields(obm orm.Ormer, deviceID string, name string, cols map[string]interface{}) error
UpdateDeviceAttrFields update special fields
func UpdateDeviceAttrMulti ¶
func UpdateDeviceAttrMulti(updates []DeviceAttrUpdate) error
UpdateDeviceAttrMulti update device attr multi
func UpdateDeviceField ¶
UpdateDeviceField update special field
func UpdateDeviceFields ¶
UpdateDeviceFields update special fields
func UpdateDeviceMulti ¶
func UpdateDeviceMulti(updates []DeviceUpdate) error
UpdateDeviceMulti update device multi
func UpdateDeviceTwinField ¶
UpdateDeviceTwinField update special field
func UpdateDeviceTwinFields ¶
func UpdateDeviceTwinFields(obm orm.Ormer, deviceID string, name string, cols map[string]interface{}) error
UpdateDeviceTwinFields update special fields
func UpdateDeviceTwinMulti ¶
func UpdateDeviceTwinMulti(updates []DeviceTwinUpdate) error
UpdateDeviceTwinMulti update device twin multi
Types ¶
type Device ¶
type Device struct { ID string `orm:"column(id); size(64); pk"` Name string `orm:"column(name); null; type(text)"` Description string `orm:"column(description); null; type(text)"` State string `orm:"column(state); null; type(text)"` LastOnline string `orm:"column(last_online); null; type(text)"` }
Device the struct of device
type DeviceAttr ¶
type DeviceAttr struct { ID int64 `orm:"column(id);size(64);auto;pk"` DeviceID string `orm:"column(deviceid); null; type(text)"` Name string `orm:"column(name);null;type(text)"` Description string `orm:"column(description);null;type(text)"` Value string `orm:"column(value);null;type(text)"` Optional bool `orm:"column(optional);null;type(integer)"` AttrType string `orm:"column(attr_type);null;type(text)"` Metadata string `orm:"column(metadata);null;type(text)"` }
DeviceAttr the struct of device attributes
type DeviceAttrUpdate ¶
DeviceAttrUpdate the struct for updating device attr
type DeviceDelete ¶
DeviceDelete the struct for deleting device
type DeviceTwin ¶
type DeviceTwin struct { ID int64 `orm:"column(id);size(64);auto;pk"` DeviceID string `orm:"column(deviceid); null; type(text)"` Name string `orm:"column(name);null;type(text)"` Description string `orm:"column(description);null;type(text)"` Expected string `orm:"column(expected);null;type(text)"` Actual string `orm:"column(actual);null;type(text)"` ExpectedMeta string `orm:"column(expected_meta);null;type(text)"` ActualMeta string `orm:"column(actual_meta);null;type(text)"` ExpectedVersion string `orm:"column(expected_version);null;type(text)"` ActualVersion string `orm:"column(actual_version);null;type(text)"` Optional bool `orm:"column(optional);null;type(integer)"` AttrType string `orm:"column(attr_type);null;type(text)"` Metadata string `orm:"column(metadata);null;type(text)"` }
DeviceTwin the struct of device twin
type DeviceTwinUpdate ¶
DeviceTwinUpdate the struct for updating device twin
type DeviceUpdate ¶
DeviceUpdate the struct for updating device