Documentation
¶
Index ¶
- func AddDeviceAttribute(device dttype.Device, attributeName string, attributeValue string, ...)
- func AddTwinAttribute(device dttype.Device, attributeName string, attributeValue string, ...)
- func CheckPodDeletion(EdgedEndPoint, UID string)
- func CheckPodRunningState(EdgedEndPoint, podname string)
- func CreateDevice(deviceID string, deviceName string, deviceState string) dttype.Device
- func GenerateDeviceID(deviceSuffix string) string
- func GetDeviceStateFromDB(deviceID string) string
- func GetPods(EdgedEndpoint string) (v1.PodList, error)
- func HandleAddAndDeleteDevice(operation, testMgrEndPoint string, device dttype.Device) bool
- func HandleAddAndDeletePods(operation string, edgedpoint string, UID string, container []v1.Container, ...) bool
- func HubClientInit(server, clientID, username, password string) *MQTT.ClientOptions
- type Attribute
- type Device
- type DeviceUpdate
- type TwinAttribute
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDeviceAttribute ¶
func AddDeviceAttribute(device dttype.Device, attributeName string, attributeValue string, attributeType string)
Function to add Device attribute to existing device
func AddTwinAttribute ¶
func AddTwinAttribute(device dttype.Device, attributeName string, attributeValue string, attributeType string)
Function to add Twin attribute to existing device
func CheckPodDeletion ¶
func CheckPodDeletion(EdgedEndPoint, UID string)
CheckPodDeletion is function to check pod deletion
func CheckPodRunningState ¶
func CheckPodRunningState(EdgedEndPoint, podname string)
CheckPodRunningState is function to check the Pod state
func CreateDevice ¶
Function to Generate Device
func GenerateDeviceID ¶
func GetDeviceStateFromDB ¶
Function to access the edgecore DB and return the device state.
func HandleAddAndDeleteDevice ¶
function to handle device addition and deletion.
func HandleAddAndDeletePods ¶
func HandleAddAndDeletePods(operation string, edgedpoint string, UID string, container []v1.Container, restartPolicy v1.RestartPolicy) bool
HandleAddAndDeletePods is function to handle app deployment/delete deployment.
func HubClientInit ¶
func HubClientInit(server, clientID, username, password string) *MQTT.ClientOptions
HubclientInit create mqtt client config
Types ¶
type Attribute ¶
type Attribute struct { ID string `json:"id,omitempty"` DeviceID string `json:"deviceid,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Value string `json:"value,omitempty"` Optional bool `json:"optional,omitempty"` Type string `json:"attr_type,omitempty"` MetaData string `json:"metadata,omitempty"` }
Attribute Structure to read data from DB (Should match with the DB-table 'device_attr' schema)
type Device ¶
type Device struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` State string `json:"state,omitempty"` LastOnline string `json:"last_online,omitempty"` }
Device the struct of device
type DeviceUpdate ¶
type DeviceUpdate struct { State string `json:"state,omitempty"` Attributes map[string]*dttype.MsgAttr `json:"attributes"` }
DeviceUpdate device update
type TwinAttribute ¶
type TwinAttribute struct { ID string `json:"id,omitempty"` DeviceID string `json:"deviceid,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Expected string `json:"expected,omitempty"` Actual string `json:"actual,omitempty"` ExpectedMeta string `json:"expected_meta,omitempty"` ActualMeta string `json:"actual_meta,omitempty"` ExpectedVer string `json:"expected_version,omitempty"` ActualVer string `json:"actual_version,omitempty"` Optional bool `json:"optional,omitempty"` Type string `json:"attr_type,omitempty"` MetaData string `json:"metadata,omitempty"` }
Twin Structure to read data from DB (Should match with the DB-table 'device_twin' schema)
func GetTwinAttributesFromDB ¶
func GetTwinAttributesFromDB(deviceID string, Name string) TwinAttribute