types

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2021 License: Apache-2.0 Imports: 1 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"`
	// A list of device twins containing desired/reported desired/reported values of twin properties..
	// Optional: A passive device won't have twin properties and this list could be empty.
	// +optional
	Twins []v1alpha2.Twin `json:"twins,omitempty"`
	// A list of data properties, which are not required to be processed by edgecore
	// +optional
	DataProperties []v1alpha2.DataProperty `json:"dataProperties,omitempty"`
	// Topic used by mapper, all data collected from dataProperties
	// should be published to this topic,
	// the default value is $ke/events/device/+/data/update
	// +optional
	DataTopic string `json:"dataTopic,omitempty"`
	// PropertyVisitors is list of all PropertyVisitors in DeviceModels
	PropertyVisitors []*PropertyVisitor `json:"propertyVisitors,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"`
}

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, double and float
	Minimum interface{} `json:"minimum,omitempty"`
	// Maximum is property maximum value in case of int, double and float
	Maximum interface{} `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"`
	// Define how frequent mapper will report the value.
	ReportCycle int64 `json:"reportCycle,omitempty"`
	// Define how frequent mapper will collect from device.
	CollectCycle int64 `json:"collectCycle,omitempty"`
	// Customized values for visitor of provided protocols
	// +optional
	CustomizedValues interface{} `json:"customizedValues,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:"protocolConfig"`
	// ProtocolCommonConfig is common part of protocol config
	ProtocolCommonConfig interface{} `json:"protocolCommonConfig"`
}

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