agent

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: Apache-2.0 Imports: 20 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v0.0.16

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

Client 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 (*Client) Close added in v0.0.16

func (a *Client) Close()

Close closes the underlying connection.

func (*Client) Connect added in v0.0.16

func (a *Client) Connect() (int, error)

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

func (*Client) Recv added in v0.0.16

func (a *Client) Recv() (*client.Packet, error)

func (*Client) Send added in v0.0.16

func (a *Client) Send(pkt *client.Packet) error

func (*Client) Serve added in v0.0.16

func (a *Client) 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 *Client) 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
	AgentIdentifiers        string
	SyncInterval            time.Duration
	ProbeInterval           time.Duration
	SyncIntervalCap         time.Duration
	DialOptions             []grpc.DialOption
	ServiceAccountTokenPath string
	WarnOnChannelLimit      bool
	SyncForever             bool
}

func (*ClientSetConfig) NewAgentClientSet

func (cc *ClientSetConfig) NewAgentClientSet(stopCh <-chan struct{}) *ClientSet

type DuplicateServerError added in v0.0.27

type DuplicateServerError struct {
	ServerID string
}

func (*DuplicateServerError) Error added in v0.0.27

func (dse *DuplicateServerError) Error() string

type IdentifierType added in v0.0.15

type IdentifierType string
const (
	IPv4         IdentifierType = "ipv4"
	IPv6         IdentifierType = "ipv6"
	Host         IdentifierType = "host"
	CIDR         IdentifierType = "cidr"
	UID          IdentifierType = "uid"
	DefaultRoute IdentifierType = "default-route"
)

type Identifiers added in v0.0.16

type Identifiers struct {
	IPv4         []string
	IPv6         []string
	Host         []string
	CIDR         []string
	DefaultRoute bool
}

Identifiers stores agent identifiers that will be used by the server when choosing agents

func GenAgentIdentifiers added in v0.0.15

func GenAgentIdentifiers(addrs string) (Identifiers, error)

GenAgentIdentifiers generates an Identifiers based on the input string, the input string should be a comma-seprated list with each item in the format of <IdentifierType>=<address>

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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