Documentation
¶
Index ¶
- Constants
- func BuildResource(nodeID, namespace, resourceType, resourceID string) (resource string, err error)
- func BuildResourceForDevice(nodeID, resourceType, resourceID string) (resource string, err error)
- func BuildResourceForRouter(resourceType, resourceID string) (string, error)
- func GetDeviceID(resource string) (string, error)
- func GetNamespace(msg model.Message) (string, error)
- func GetNodeID(msg model.Message) (string, error)
- func GetResourceName(msg model.Message) (string, error)
- func GetResourceType(msg model.Message) (string, error)
- func GetResourceTypeForDevice(resource string) (string, error)
- type ContextMessageLayer
- type MessageLayer
Constants ¶
const ( ResourceNode = "node" ResourceNodeIDIndex = 1 ResourceNamespaceIndex = 2 ResourceResourceTypeIndex = 3 ResourceResourceNameIndex = 4 ResourceDeviceIndex = 2 ResourceDeviceIDIndex = 3 ResourceDevice = "device" ResourceTypeTwinEdgeUpdated = "twin/edge_updated" ResourceTypeMembershipDetail = "membership/detail" )
Variables ¶
This section is empty.
Functions ¶
func BuildResource ¶
BuildResource return a string as "beehive/pkg/core/model".Message.Router.Resource
func BuildResourceForDevice ¶
BuildResourceForDevice return a string as "beehive/pkg/core/model".Message.Router.Resource
func BuildResourceForRouter ¶
BuildResourceForRouter return a string as "beehive/pkg/core/model".Message.Router.Resource
func GetDeviceID ¶
GetDeviceID returns the ID of the device
func GetNamespace ¶
GetNamespace from "beehive/pkg/core/model".Model.Router.Resource
func GetResourceName ¶
GetResourceName from "beehive/pkg/core/model".Model.Router.Resource
func GetResourceType ¶
GetResourceType from "beehive/pkg/core/model".Model.Router.Resource
func GetResourceTypeForDevice ¶
GetResourceType returns the resourceType of message received from edge
Types ¶
type ContextMessageLayer ¶
type ContextMessageLayer struct { // SendModuleName indicates which module will send message to SendModuleName string // SendRouterModuleName indicates which module will send router message to SendRouterModuleName string // ReceiveModuleName indicates which module will receive message from ReceiveModuleName string // ResponseModuleName indicates which module will response message to ResponseModuleName string }
ContextMessageLayer build on context
func (*ContextMessageLayer) Receive ¶
func (cml *ContextMessageLayer) Receive() (model.Message, error)
Receive message
type MessageLayer ¶
type MessageLayer interface { Send(message model.Message) error Receive() (model.Message, error) Response(message model.Message) error }
MessageLayer define all functions that message layer must implement
func DeviceControllerMessageLayer ¶
func DeviceControllerMessageLayer() MessageLayer
func DynamicControllerMessageLayer ¶
func DynamicControllerMessageLayer() MessageLayer
func EdgeControllerMessageLayer ¶
func EdgeControllerMessageLayer() MessageLayer