messagelayer

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildResource

func BuildResource(nodeID, namespace, resourceType, resourceID string) (resource string, err error)

BuildResource return a string as "beehive/pkg/core/model".Message.Router.Resource

func BuildResourceForRouter

func BuildResourceForRouter(resourceType, resourceID string) (string, error)

BuildResourceForRouter return a string as "beehive/pkg/core/model".Message.Router.Resource

func GetNamespace

func GetNamespace(msg model.Message) (string, error)

GetNamespace from "beehive/pkg/core/model".Model.Router.Resource

func GetNodeID

func GetNodeID(msg model.Message) (string, error)

GetNodeID from "beehive/pkg/core/model".Message.Router.Resource

func GetResourceName

func GetResourceName(msg model.Message) (string, error)

GetResourceName from "beehive/pkg/core/model".Model.Router.Resource

func GetResourceType

func GetResourceType(msg model.Message) (string, error)

GetResourceType from "beehive/pkg/core/model".Model.Router.Resource

Types

type ContextMessageLayer

type ContextMessageLayer struct {
	SendModuleName       string
	SendRouterModuleName string
	ReceiveModuleName    string
	ResponseModuleName   string
}

ContextMessageLayer build on context

func (*ContextMessageLayer) Receive

func (cml *ContextMessageLayer) Receive() (model.Message, error)

Receive message

func (*ContextMessageLayer) Response

func (cml *ContextMessageLayer) Response(message model.Message) error

Response message

func (*ContextMessageLayer) Send

func (cml *ContextMessageLayer) Send(message model.Message) error

Send 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 NewContextMessageLayer

func NewContextMessageLayer() MessageLayer

NewContextMessageLayer create a ContextMessageLayer

Jump to

Keyboard shortcuts

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