clientutil

package
Version: v0.0.0-...-a3b6696 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClientAlreadyConnected = errors.New("client already connected")
	ErrClientNotConnected     = errors.New("client not connected")
	ErrCmdRecvClosed          = errors.New("cmd recv closed")
)

Functions

func CreateOnlineOfflineMessage

func CreateOnlineOfflineMessage(clientID string) (onlineMsgBytes, offlineMsgBytes []byte)

Types

type BaseClient

type BaseClient struct {
	Log log.Interface
	// contains filtered or unexported fields
}

func NewBaseClient

func NewBaseClient(
	ctx context.Context,
	handleCmd types.AgentCmdHandleFunc,
	maxPayloadSize int,
) (*BaseClient, error)

func (*BaseClient) Context

func (b *BaseClient) Context() context.Context

func (*BaseClient) HandleCmd

func (b *BaseClient) HandleCmd(cmdBytes []byte)

func (*BaseClient) MaxPayloadSize

func (b *BaseClient) MaxPayloadSize() int

func (*BaseClient) OnClose

func (b *BaseClient) OnClose(doExit func() error) error

type CommonConfig

type CommonConfig struct {
	Endpoint       string              `json:"endpoint" yaml:"endpoint"`
	MaxPayloadSize int                 `json:"maxPayloadSize" yaml:"maxPayloadSize"`
	TLS            tlshelper.TLSConfig `json:"tls" yaml:"tls"`
}

Jump to

Keyboard shortcuts

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