controlchannel

package
v0.0.0-...-955c50f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Overview

Package controlchannel implement control communicator for web socket connection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControlChannel

type ControlChannel struct {
	ChannelId         string
	Service           service.Service
	AuditLogScheduler telemetry.IAuditLogTelemetry
	// contains filtered or unexported fields
}

ControlChannel used for communication between the message gateway service and the agent.

func (*ControlChannel) Close

func (controlChannel *ControlChannel) Close(log log.T) error

Close closes controlchannel - its web socket connection.

func (*ControlChannel) Initialize

func (controlChannel *ControlChannel) Initialize(context context.T,
	mgsService service.Service,
	instanceId string,
	agentMessageIncomingMessageChan chan mgsContracts.AgentMessage)

Initialize populates controlchannel object and opens controlchannel to communicate with mgs.

func (*ControlChannel) Open

func (controlChannel *ControlChannel) Open(context context.T, ableToOpenMGSConnection *uint32) error

Open opens a websocket connection and sends the token for service to acknowledge the connection.

func (*ControlChannel) Reconnect

func (controlChannel *ControlChannel) Reconnect(context context.T, ableToOpenMGSConnection *uint32) error

Reconnect reconnects a controlchannel.

func (*ControlChannel) SendMessage

func (controlChannel *ControlChannel) SendMessage(log log.T, input []byte, inputType int) error

SendMessage sends a message to the service through control channel.

func (*ControlChannel) SetWebSocket

func (controlChannel *ControlChannel) SetWebSocket(context context.T,
	mgsService service.Service, ableToOpenMGSConnection *uint32) error

SetWebSocket populates webchannel object.

type IControlChannel

type IControlChannel interface {
	Initialize(context context.T, mgsService service.Service, instanceId string, agentMessageIncomingMessageChan chan mgsContracts.AgentMessage)
	SetWebSocket(context context.T, mgsService service.Service, ableToOpenMGSConnection *uint32) error
	SendMessage(log log.T, input []byte, inputType int) error
	Reconnect(context context.T, ableToOpenMGSConnection *uint32) error
	Close(log log.T) error
	Open(context context.T, ableToOpenMGSConnection *uint32) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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