types

package
v1.17.0-beta.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 0 Imported by: 25

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseMessage

type BaseMessage struct {
	EventID   string `json:"event_id"`
	Timestamp int64  `json:"timestamp"`
}

BaseMessage the base struct of event message

type ConnectedInfo

type ConnectedInfo struct {
	EventType string `json:"event_type"`
	TimeStamp int64  `json:"timestamp"`
}

ConnectedInfo connected info

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"`
	Attributes  map[string]*MsgAttr `json:"attributes,omitempty"`
	Twin        map[string]*MsgTwin `json:"twin,omitempty"`
}

Device the struct of device

type DeviceTwinDocument

type DeviceTwinDocument struct {
	BaseMessage
	Twin map[string]*TwinDoc `json:"twin"`
}

DeviceTwinDocument the struct of twin document

type DeviceTwinUpdate

type DeviceTwinUpdate struct {
	BaseMessage
	Twin map[string]*MsgTwin `json:"twin"`
}

DeviceTwinUpdate the struct of device twin update

type MembershipDetail

type MembershipDetail struct {
	BaseMessage
	Devices []Device `json:"devices"`
}

MembershipDetail the struct of membership detail

type MembershipUpdate

type MembershipUpdate struct {
	BaseMessage
	AddDevices    []Device `json:"added_devices"`
	RemoveDevices []Device `json:"removed_devices"`
}

MembershipUpdate the struct of membership update

type MsgAttr

type MsgAttr struct {
	Value    string        `json:"value"`
	Optional *bool         `json:"optional,omitempty"`
	Metadata *TypeMetadata `json:"metadata,omitempty"`
}

MsgAttr the struct of device attr

type MsgTwin

type MsgTwin struct {
	Expected        *TwinValue    `json:"expected,omitempty"`
	Actual          *TwinValue    `json:"actual,omitempty"`
	Optional        *bool         `json:"optional,omitempty"`
	Metadata        *TypeMetadata `json:"metadata,omitempty"`
	ExpectedVersion *TwinVersion  `json:"expected_version,omitempty"`
	ActualVersion   *TwinVersion  `json:"actual_version,omitempty"`
}

MsgTwin the struct of device twin

type Parameter

type Parameter struct {
	EventID string
	Code    int
	Reason  string
}

Parameter container para

type Result

type Result struct {
	BaseMessage
	Code   int    `json:"code,omitempty"`
	Reason string `json:"reason,omitempty"`
}

Result the struct of Result for sending

type TwinDoc

type TwinDoc struct {
	LastState    *MsgTwin `json:"last"`
	CurrentState *MsgTwin `json:"current"`
}

TwinDoc the struct of twin document

type TwinValue

type TwinValue struct {
	Value    *string        `json:"value,omitempty"`
	Metadata *ValueMetadata `json:"metadata,omitempty"`
}

TwinValue the struct of twin value

type TwinVersion

type TwinVersion struct {
	CloudVersion int64 `json:"cloud"`
	EdgeVersion  int64 `json:"edge"`
}

TwinVersion twin version

type TypeMetadata

type TypeMetadata struct {
	Type string `json:"type,omitempty"`
}

TypeMetadata the meta of value type

type ValueMetadata

type ValueMetadata struct {
	Timestamp int64 `json:"timestamp,omitempty"`
}

ValueMetadata the meta of value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL