types

package
v0.0.0-...-2d43aa0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

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 DeviceInstance

type DeviceInstance struct {
	// ID is deviceInstance ID
	ID string `json:"id,omitempty"`
	// Name is deviceInstance name
	Name string `json:"name,omitempty"`
	// Protocol is deviceInstance protocol name. It is generated by deviceController
	Protocol string `json:"protocol,omitempty"`
	// Model is deviceInstance model name
	Model string `json:"model,omitempty"`
}

DeviceInstance is structure to store device in deviceProfile.json in configmap

type DeviceModel

type DeviceModel struct {
	// Name is DeviceModel name
	Name string `json:"name,omitempty"`
	// Description is DeviceModel description
	Description string `json:"description,omitempty"`
	// Properties is list of DeviceModel properties
	Properties []*Property `json:"properties,omitempty"`
}

DeviceModel is structure to store deviceModel in deviceProfile.json in configmap

type DeviceProfile

type DeviceProfile struct {
	// DeviceInstances is used to store list of all devices.
	DeviceInstances []*DeviceInstance `json:"deviceInstances,omitempty"`
	// DeviceModels is used to store list of all DeviceModels referenced by DeviceInstances
	DeviceModels []*DeviceModel `json:"deviceModels,omitempty"`
	// Protocols is list of all protocols used by DeviceInstances
	Protocols []*Protocol `json:"protocols,omitempty"`
	// PropertyVisitors is list of all PropertyVisitors in DeviceModels
	PropertyVisitors []*PropertyVisitor `json:"propertyVisitors,omitempty"`
}

DeviceProfile is structure to store in configMap. These types would be consumed by mappers to marshal / unmarshal the device profile json

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 Property

type Property struct {
	// Name is Property name
	Name string `json:"name,omitempty"`
	// DataType is property dataType
	DataType string `json:"dataType,omitempty"`
	// Description is property description
	Description string `json:"description,omitempty"`
	// AccessMode is property accessMode
	AccessMode string `json:"accessMode,omitempty"`
	// DefaultValue is property defaultValue
	DefaultValue interface{} `json:"defaultValue,omitempty"`
	// Minimum is property minimum value in case of int
	Minimum int64 `json:"minimum,omitempty"`
	// Maximum is property maximum value in case of int
	Maximum int64 `json:"maximum,omitempty"`
	// Unit is unit of measurement
	Unit string `json:"unit,omitempty"`
}

Property is structure to store deviceModel property

type PropertyVisitor

type PropertyVisitor struct {
	// Name is propertyVisitor name
	Name string `json:"name,omitempty"`
	// PropertyName is name of property it is mapped to
	PropertyName string `json:"propertyName,omitempty"`
	// ModelName is deviceModel name
	ModelName string `json:"modelName,omitempty"`
	// Protocol is protocol of propertyVisitor
	Protocol string `json:"protocol,omitempty"`
	// VisitorConfig is property visitor configuration
	VisitorConfig interface{} `json:"visitorConfig,omitempty"`
}

PropertyVisitor is structure to store propertyVisitor in deviceProfile.json in configmap

type Protocol

type Protocol struct {
	// Name is protocol name
	Name string `json:"name,omitempty"`
	// Protocol is protocol name defined in deviceInstance. It is generated by deviceController
	Protocol string `json:"protocol,omitempty"`
	// ProtocolConfig is protocol config
	ProtocolConfig interface{} `json:"protocol_config"`
}

Protocol is structure to store protocol in deviceProfile.json in configmap

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