dtcommon

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 14 Imported by: 9

Documentation

Index

Constants

View Source
const (
	// RetryTimes for retry times
	RetryTimes = 5
	// RetryInterval for retry interval
	RetryInterval = 1 * time.Second

	// LifeCycleConnectETPrefix the topic prefix for connected event
	LifeCycleConnectETPrefix = "$hw/events/connected/"
	// LifeCycleDisconnectETPrefix the topic prefix for disconnected event
	LifeCycleDisconnectETPrefix = "$hw/events/disconnected/"

	// MemETPrefix the topic prefix for membership event
	MemETPrefix = "$hw/events/node/"
	// MemETUpdateSuffix the topic suffix for membership updated event
	MemETUpdateSuffix = "/membership/updated"
	// MemETDetailSuffix the topic suffix for membership detail
	MemETDetailSuffix = "/membership/detail"
	// MemETDetailResultSuffix the topic suffix for membership detail event
	MemETDetailResultSuffix = "/membership/detail/result"
	// MemETGetSuffix the topic suffix for membership get
	MemETGetSuffix = "/membership/get"
	// MemETGetResultSuffix the topic suffix for membership get event
	MemETGetResultSuffix = "/membership/get/result"

	// DeviceETPrefix the topic prefix for device event
	DeviceETPrefix = "$hw/events/device/"
	// TwinETUpdateSuffix the topic suffix for twin update event
	TwinETUpdateSuffix = "/twin/update"
	// TwinETUpdateResultSuffix the topic suffix for twin update result event
	TwinETUpdateResultSuffix = "/twin/update/result"
	// TwinETGetSuffix the topic suffix for twin get
	TwinETGetSuffix = "/twin/get"
	// TwinETGetResultSuffix the topic suffix for twin get event
	TwinETGetResultSuffix = "/twin/get/result"
	// TwinETCloudSyncSuffix the topic suffix for twin sync event
	TwinETCloudSyncSuffix = "/twin/cloud_updated"
	// TwinETEdgeSyncSuffix the topic suffix for twin sync event
	TwinETEdgeSyncSuffix = "/twin/edge_updated"
	// TwinETDeltaSuffix the topic suffix for twin delta event
	TwinETDeltaSuffix = "/twin/update/delta"
	// TwinETDocumentSuffix the topic suffix for twin document event
	TwinETDocumentSuffix = "/twin/update/document"

	// DeviceETUpdatedSuffix the topic suffix for device updated event
	DeviceETUpdatedSuffix = "/updated"
	// DeviceETStateUpdateSuffix the topic suffix for device state update event
	DeviceETStateUpdateSuffix = "/state/update"
	// DeviceETStateUpdateResultSuffix the topic suffix for device state update result event
	DeviceETStateUpdateResultSuffix = "/state/update/result"
	// DeviceETStateGetSuffix the topic suffix for device state get event
	DeviceETStateGetSuffix = "/state/get"

	// MemDetailResult membership detail result
	MemDetailResult = "MemDetailResult"
	// MemDetail membership detail
	MemDetail = "MemDetail"
	// MemGet get
	MemGet = "MemGet"
	// MemUpdated membership updated
	MemUpdated = "MemUpdated"

	// TwinGet get twin
	TwinGet = "TwinGet"
	// TwinUpdate twin update
	TwinUpdate = "TwinUpdate"
	// TwinCloudSync twin cloud sync
	TwinCloudSync = "TwinCloudSync"
	// TwinEdgeSync twin edge sync
	TwinEdgeSync = "TwinEdgeSync"

	// DeviceUpdated device attributes update
	DeviceUpdated = "DeviceUpdated"
	// DeviceStateGet device state get
	DeviceStateGet = "DeviceStateGet"
	// DeviceStateUpdate device state update
	DeviceStateUpdate = "DeviceStateUpdate"

	// SendToEdge send info to edge
	SendToEdge = "SendToEdge"
	// SendToCloud send info to cloud
	SendToCloud = "SendToCloud"
	// LifeCycle life cycle
	LifeCycle = "LifeCycle"
	// Connected event
	Connected = "connected"
	// Confirm event
	Confirm = "Confirm"
	// Disconnected event
	Disconnected = "disconnected"
	// MetaDeviceOperation event
	MetaDeviceOperation = "MetaDeviceOperation"

	// CommModule communicate module
	CommModule = "CommModule"
	// DeviceModule device module
	DeviceModule = "DeviceModule"
	// MemModule membership module
	MemModule = "MemModule"
	// TwinModule twin module
	TwinModule = "TwinModule"
	// DMIModule DMI module
	DMIModule = "DMIModule"
	// HubModule the name of hub module
	HubModule = "websocket"
	// EventHubModule the name of event hub module
	EventHubModule = "eventbus"
	// DeviceTwinModule the name of twin module
	DeviceTwinModule = "twin"

	// BadRequestCode bad request
	BadRequestCode = 400
	// NotFoundCode device not found
	NotFoundCode = 404
	// ConflictCode version conflict
	ConflictCode = 409
	// InternalErrorCode server internal error
	InternalErrorCode = 500

	TypeDeleted = "deleted"
	TypeUpdated = "updated"
)

Variables

This section is empty.

Functions

func ConvertDevice added in v1.12.0

func ConvertDevice(device *v1beta1.Device) (*pb.Device, error)

func ConvertDeviceModel added in v1.12.0

func ConvertDeviceModel(model *v1beta1.DeviceModel) (*pb.DeviceModel, error)

func ValidateTwinKey

func ValidateTwinKey(key string) bool

ValidateTwinKey validate twin key

func ValidateTwinValue

func ValidateTwinValue(value string) bool

ValidateTwinValue validate twin value

func ValidateValue

func ValidateValue(valueType string, value string) error

ValidateValue validate value type

Types

This section is empty.

Jump to

Keyboard shortcuts

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