controlprotocol

package
v0.25.2 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ServerPort is the port used when initializing the control-protocol server
	ServerPort = 8085
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncHandlerFunc

type AsyncHandlerFunc = func(ctx context.Context, commandMessage ctrlservice.AsyncCommandMessage)

AsyncHandlerFunc is an alias that matches the type used in the control-protocol's NewAsyncCommandHandler function

type ServerHandler

type ServerHandler interface {
	Shutdown(timeout time.Duration)
	AddAsyncHandler(opcode ctrl.OpCode, resultOpcode ctrl.OpCode, payloadType message.AsyncCommand, handler AsyncHandlerFunc)
	AddSyncHandler(opcode ctrl.OpCode, handler ctrl.MessageHandlerFunc)
	RemoveHandler(opcode ctrl.OpCode)
}

ServerHandler defines the interface for adding and removing sync or async handlers from a control-protocol server

func NewServerHandler

func NewServerHandler(ctx context.Context, port int) (ServerHandler, error)

NewServerHandler starts a control-protocol server on the specified port and returns the serverHandlerImpl as a ServerHandler interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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