agentclient

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentClient

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

AgentClient runs on the node network side. It connects to proxy server and establishes a stream connection from which it sends and receives network traffic.

func (*AgentClient) Close

func (c *AgentClient) Close()

Close closes the underlying stream.

func (*AgentClient) Serve

func (a *AgentClient) Serve()

Serve starts to serve proxied requests from proxy server over the gRPC stream. Successful Connect is required before Serve. The The requests include things like opening a connection to a server, streaming data and close the connection.

type ClientSet

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

ClientSet consists of clients connected to each instance of an HA proxy server.

func (*ClientSet) AddClient

func (cs *ClientSet) AddClient(serverID string, c *AgentClient) error

func (*ClientSet) ClientsCount

func (cs *ClientSet) ClientsCount() int

func (*ClientSet) HasID

func (cs *ClientSet) HasID(serverID string) bool

func (*ClientSet) HealthyClientsCount

func (cs *ClientSet) HealthyClientsCount() int

func (*ClientSet) RemoveClient

func (cs *ClientSet) RemoveClient(serverID string)

func (*ClientSet) Serve

func (cs *ClientSet) Serve()

type ClientSetConfig

type ClientSetConfig struct {
	Address           string
	AgentID           string
	SyncInterval      time.Duration
	ProbeInterval     time.Duration
	ReconnectInterval time.Duration
	DialOption        grpc.DialOption
}

func (*ClientSetConfig) NewAgentClientSet

func (cc *ClientSetConfig) NewAgentClientSet() *ClientSet

type ReconnectError

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

func (*ReconnectError) Error

func (e *ReconnectError) Error() string

func (*ReconnectError) Wait

func (e *ReconnectError) Wait() error

type RedialableAgentClient

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

func NewRedialableAgentClient

func NewRedialableAgentClient(address, agentID string, cs *ClientSet, opts ...grpc.DialOption) (*RedialableAgentClient, error)

func (*RedialableAgentClient) Close

func (c *RedialableAgentClient) Close()

func (*RedialableAgentClient) Connect

func (c *RedialableAgentClient) Connect() (string, error)

Connect makes the grpc dial to the proxy server. It returns the serverID it connects to.

func (*RedialableAgentClient) Recv

func (c *RedialableAgentClient) Recv() (*agent.Packet, error)

func (*RedialableAgentClient) RetrySend

func (c *RedialableAgentClient) RetrySend(pkt *agent.Packet) error

func (*RedialableAgentClient) Send

func (c *RedialableAgentClient) Send(pkt *agent.Packet) error

Jump to

Keyboard shortcuts

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