xds_v2

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterType  = resource.ClusterType
	EndpointType = resource.EndpointType
	ListenerType = resource.ListenerType
	RouteType    = resource.RouteType
	SecretType   = resource.SecretType
	RuntimeType  = resource.RuntimeType
	AnyType      = resource.AnyType
)

Variables

This section is empty.

Functions

func GetEndpointNames

func GetEndpointNames(v *envoy_api_v2.Cluster) []string

GetEndpointNames returns the EDS names for CDS

func GetRouteNames

func GetRouteNames(v *envoy_api_v2.Listener) []string

GetRouteNames returns the RDS names for LDS

Types

type Client

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

Client implements a client for xDS.

func NewClient

func NewClient(url string, tlsConfig *tls.Config, opts *Config) *Client

NewClient connects to a xDS server, with optional TLS authentication if a cert dir is specified.

func (*Client) Clone

func (c *Client) Clone() *Client

Clone the once.

func (*Client) Close

func (c *Client) Close() error

Close the once.

func (*Client) Node

func (c *Client) Node() *envoy_api_v2_core.Node

func (*Client) Run

func (c *Client) Run(ctx context.Context) error

Run the xDS client.

func (*Client) Send

func (c *Client) Send(req *envoy_api_v2.DiscoveryRequest) error

func (*Client) SendRsc

func (c *Client) SendRsc(typeURL string, rsc []string) error

func (*Client) Start

func (c *Client) Start(ctx context.Context) error

type Config

type Config struct {
	utils.NodeConfig
	OnConnect      func(cli *Client) error
	ContextDialer  func(ctx context.Context, address string) (net.Conn, error)
	HandleCDS      func(cli *Client, clusters []*envoy_api_v2.Cluster)
	HandleEDS      func(cli *Client, endpoints []*envoy_api_v2.ClusterLoadAssignment)
	HandleLDS      func(cli *Client, listeners []*envoy_api_v2.Listener)
	HandleRDS      func(cli *Client, routes []*envoy_api_v2.RouteConfiguration)
	HandleSDS      func(cli *Client, secrets []*envoy_api_v2_auth.Secret)
	HandleNotFound func(cli *Client, others []*any.Any)
}

Config for the Client connection.

Jump to

Keyboard shortcuts

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