route

package
v0.1.3-0...-617a0de Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// InvalidRequestErrorCode for invalid requests
	InvalidRequestErrorCode = command.Code(iota + command.ROUTE)

	// ResponseWriteErrorCode for response write error
	RegisterMissingConnIDCode

	// RegisterRouterErrorCode for register router error
	RegisterRouterErrorCode

	// UnregisterRouterErrorCode for unregister router error
	UnregisterRouterErrorCode

	// Connection for get connection id error
	GetConnectionIDErrorCode
)

Error codes

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	// contains filtered or unexported fields
}

Command contains command operations provided by route controller.

func New

func New(ctx provider) (*Command, error)

New returns new route controller command instance.

func (*Command) Connection

func (o *Command) Connection(rw io.Writer, req io.Reader) command.Error

Connection returns the connectionID of the router.

func (*Command) GetHandlers

func (o *Command) GetHandlers() []command.Handler

GetHandlers returns list of all commands supported by this controller command

func (*Command) Register

func (o *Command) Register(rw io.Writer, req io.Reader) command.Error

Register registers the agent with the router.

func (*Command) Unregister

func (o *Command) Unregister(rw io.Writer, req io.Reader) command.Error

Unregister unregisters the agent with the router.

type RegisterRoute

type RegisterRoute struct {
	ConnectionID string `json:"connectionID"`
}

RegisterRoute contains parameters for registering router.

Jump to

Keyboard shortcuts

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