adsc

package
v0.0.0-...-48a44ca Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTimeout is returned by Wait if no update is received in the given time.
	ErrTimeout = errors.New("timeout")
)

Functions

This section is empty.

Types

type ADSC

type ADSC struct {
	InitialLoad time.Duration

	TCPListeners  map[string]*xdsapi.Listener
	HTTPListeners map[string]*xdsapi.Listener
	Clusters      map[string]*xdsapi.Cluster
	Routes        map[string]*xdsapi.RouteConfiguration
	EDS           map[string]*xdsapi.ClusterLoadAssignment

	// Metadata has the node metadata to send to pilot.
	// If nil, the defaults will be used.
	Metadata map[string]string

	// Updates includes the type of the last update received from the server.
	Updates     chan string
	VersionInfo map[string]string
	// contains filtered or unexported fields
}

ADSC implements a basic client for ADS, for use in stress tests and tools or libraries that need to connect to Istio pilot or other ADS servers.

func Dial

func Dial(url string, certDir string, opts *Config) (*ADSC, error)

Dial connects to a ADS server, with optional MTLS authentication if a cert dir is specified.

func (*ADSC) Close

func (a *ADSC) Close()

Close the stream.

func (*ADSC) EndpointsJSON

func (a *ADSC) EndpointsJSON() string

EndpointsJSON returns the endpoints, formatted as JSON, for debugging.

func (*ADSC) Run

func (a *ADSC) Run() error

Run will run the ADS client.

func (*ADSC) Wait

func (a *ADSC) Wait(update string, to time.Duration) (string, error)

Wait for an update of the specified type. If type is empty, wait for next update.

func (*ADSC) WaitClear

func (a *ADSC) WaitClear()

WaitClear will clear the waiting events, so next call to Wait will get the next push type.

func (*ADSC) Watch

func (a *ADSC) Watch()

Watch will start watching resources, starting with LDS. Based on the LDS response it will start watching RDS and CDS.

type Config

type Config struct {
	// Namespace defaults to 'default'
	Namespace string

	// Workload defaults to 'test'
	Workload string

	// Meta includes additional metadata for the node
	Meta map[string]string

	// NodeType defaults to sidecar. "ingress" and "router" are also supported.
	NodeType string
	IP       string
}

Config for the ADS connection.

Jump to

Keyboard shortcuts

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