Documentation ¶
Index ¶
- Constants
- Variables
- func InitHandler(eventq *channelq.ChannelMessageQueue)
- type ExitCode
- type HandleFunc
- type MessageHandle
- func (mh *MessageHandle) HandleServer(container *mux.MessageContainer, writer mux.ResponseWriter)
- func (mh *MessageHandle) KeepaliveCheckLoop(info *model.HubInfo, stopServe chan ExitCode)
- func (mh *MessageHandle) ListMessageWriteLoop(info *model.HubInfo, stopServe chan ExitCode)
- func (mh *MessageHandle) MessageWriteLoop(info *model.HubInfo, stopServe chan ExitCode)
- func (mh *MessageHandle) OnRegister(connection conn.Connection)
- func (mh *MessageHandle) PubToController(info *model.HubInfo, msg *beehiveModel.Message) error
- func (mh *MessageHandle) RegisterNode(info *model.HubInfo) error
- func (mh *MessageHandle) ServeConn(info *model.HubInfo)
- func (mh *MessageHandle) UnregisterNode(info *model.HubInfo, code ExitCode)
Constants ¶
const ( MsgFormatError = "message format not correct" VolumePattern = `^\w[-\w.+]*/` + constants.CSIResourceTypeVolume + `/\w[-\w.+]*` )
constants for error message
Variables ¶
var VolumeRegExp = regexp.MustCompile(VolumePattern)
VolumeRegExp is used to validate the volume resource
Functions ¶
func InitHandler ¶ added in v1.6.1
func InitHandler(eventq *channelq.ChannelMessageQueue)
InitHandler create a handler for websocket and quic servers
Types ¶
type HandleFunc ¶
type MessageHandle ¶ added in v1.6.1
type MessageHandle struct { KeepaliveInterval int WriteTimeout int Nodes sync.Map MessageQueue *channelq.ChannelMessageQueue Handlers []HandleFunc NodeNumber int32 NodeLimit int32 KeepaliveChannel sync.Map MessageAcks sync.Map // contains filtered or unexported fields }
MessageHandle processes messages between cloud and edge
var CloudhubHandler *MessageHandle
CloudhubHandler the shared handler for both websocket and quic servers
func (*MessageHandle) HandleServer ¶ added in v1.6.1
func (mh *MessageHandle) HandleServer(container *mux.MessageContainer, writer mux.ResponseWriter)
HandleServer handle all the request from node
func (*MessageHandle) KeepaliveCheckLoop ¶ added in v1.6.1
func (mh *MessageHandle) KeepaliveCheckLoop(info *model.HubInfo, stopServe chan ExitCode)
KeepaliveCheckLoop checks whether the edge node is still alive
func (*MessageHandle) ListMessageWriteLoop ¶ added in v1.6.1
func (mh *MessageHandle) ListMessageWriteLoop(info *model.HubInfo, stopServe chan ExitCode)
ListMessageWriteLoop processes all list type resource write requests
func (*MessageHandle) MessageWriteLoop ¶ added in v1.6.1
func (mh *MessageHandle) MessageWriteLoop(info *model.HubInfo, stopServe chan ExitCode)
MessageWriteLoop processes all write requests
func (*MessageHandle) OnRegister ¶ added in v1.6.1
func (mh *MessageHandle) OnRegister(connection conn.Connection)
OnRegister register node on first connection
func (*MessageHandle) PubToController ¶ added in v1.6.1
func (mh *MessageHandle) PubToController(info *model.HubInfo, msg *beehiveModel.Message) error
func (*MessageHandle) RegisterNode ¶ added in v1.6.1
func (mh *MessageHandle) RegisterNode(info *model.HubInfo) error
RegisterNode register node in cloudhub for the incoming connection
func (*MessageHandle) ServeConn ¶ added in v1.6.1
func (mh *MessageHandle) ServeConn(info *model.HubInfo)
ServeConn starts serving the incoming connection
func (*MessageHandle) UnregisterNode ¶ added in v1.6.1
func (mh *MessageHandle) UnregisterNode(info *model.HubInfo, code ExitCode)
UnregisterNode unregister node in cloudhub