handler

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

Documentation

Index

Constants

View Source
const (
	MsgFormatError = "message format not correct"
	VolumePattern  = `^\w[-\w.+]*/` + constants.CSIResourceTypeVolume + `/\w[-\w.+]*`
)

constants for error message

Variables

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 ExitCode

type ExitCode int

ExitCode exit code

type HandleFunc

type HandleFunc func(info *model.HubInfo, exitServe chan ExitCode)

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

Jump to

Keyboard shortcuts

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