Documentation ¶
Index ¶
- Constants
- type AccessHandle
- type EventHandle
- func (eh *EventHandle) EventReadLoop(hi hubio.CloudHubIO, info *emodel.HubInfo, stop chan ExitCode)
- func (eh *EventHandle) EventWriteLoop(hi hubio.CloudHubIO, info *emodel.HubInfo, stop chan ExitCode)
- func (eh *EventHandle) GetNodeCount() int
- func (eh *EventHandle) GetWorkload() (float64, error)
- func (eh *EventHandle) ServeConn(hi hubio.CloudHubIO, info *emodel.HubInfo)
- type ExitCode
- type FilterWriter
Constants ¶
View Source
const (
MsgFormatError = "message format not correct"
)
constants for error message
View Source
const (
PathEvent = "/{project_id}/{node_id}/events"
)
constants for api path
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessHandle ¶
type AccessHandle struct { EventHandle *EventHandle NodeLimit int }
AccessHandle access handler
func (*AccessHandle) ServeEvent ¶
func (ah *AccessHandle) ServeEvent(w http.ResponseWriter, r *http.Request)
ServeEvent handle the event coming from websocket
func (*AccessHandle) ServeQueueWorkload ¶
func (ah *AccessHandle) ServeQueueWorkload(w http.ResponseWriter, r *http.Request)
ServeQueueWorkload handle workload from queue
type EventHandle ¶
type EventHandle struct { KeepaliveInterval int WriteTimeout int Nodes sync.Map EventQueue *channelq.ChannelEventQueue Context *context.Context // contains filtered or unexported fields }
EventHandle processes events between cloud and edge
var EventHandler *EventHandle
EventHandler handle all event
func (*EventHandle) EventReadLoop ¶
func (eh *EventHandle) EventReadLoop(hi hubio.CloudHubIO, info *emodel.HubInfo, stop chan ExitCode)
EventReadLoop processes all read requests
func (*EventHandle) EventWriteLoop ¶
func (eh *EventHandle) EventWriteLoop(hi hubio.CloudHubIO, info *emodel.HubInfo, stop chan ExitCode)
EventWriteLoop processes all write requests
func (*EventHandle) GetNodeCount ¶
func (eh *EventHandle) GetNodeCount() int
GetNodeCount returns the number of connected Nodes
func (*EventHandle) GetWorkload ¶
func (eh *EventHandle) GetWorkload() (float64, error)
GetWorkload returns the workload of the event queue
func (*EventHandle) ServeConn ¶
func (eh *EventHandle) ServeConn(hi hubio.CloudHubIO, info *emodel.HubInfo)
ServeConn starts serving the incoming connection
Click to show internal directories.
Click to hide internal directories.