Documentation ¶
Index ¶
- func AddNode(nodeName string, read ReadMsgFunc, write WriteMsgFunc, closeCh chan struct{})
- func Done() <-chan struct{}
- func ReceiveFromEdge() (nodeName string, msg model.Message, err error)
- func SendToCloud(nodeName string, msg model.Message) error
- func SendToEdge(nodeName string, msg *model.Message) error
- type ChannelContext
- type ReadMsgFunc
- type Server
- type WriteMsgFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddNode ¶
func AddNode(nodeName string, read ReadMsgFunc, write WriteMsgFunc, closeCh chan struct{})
AddNode registers a node
func ReceiveFromEdge ¶
ReceiveFromEdge receives a message from edge
func SendToCloud ¶
SendToCloud sends the message to cloud from specified node name
Types ¶
type ChannelContext ¶
type ChannelContext struct {
// contains filtered or unexported fields
}
ChannelContext is object for Context channel
func NewChannelContext ¶
func NewChannelContext() *ChannelContext
NewChannelContext creates a ChannelContext
type ReadMsgFunc ¶
ReadMsgFunc defines read msg callback
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server defines websocket protocol server
func (*Server) ListenAndServe ¶
ListenAndServe listens and serves the server
type WriteMsgFunc ¶
WriteMsgFunc defines write msg callback
Click to show internal directories.
Click to hide internal directories.