istio: Index | Files

package adsc

import ""


Package Files


type ADSC Uses

type ADSC struct {

    // InitialLoad tracks the time to receive the initial configuration.
    InitialLoad time.Duration

    // Metadata has the node metadata to send to pilot.
    // If nil, the defaults will be used.
    Metadata *pstruct.Struct

    // 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 Uses

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 Uses

func (a *ADSC) Close()

Close the stream.

func (*ADSC) EndpointsJSON Uses

func (a *ADSC) EndpointsJSON() string

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

func (*ADSC) GetClusters Uses

func (a *ADSC) GetClusters() map[string]*xdsapi.Cluster

GetClusters returns all the non-eds type clusters.

func (*ADSC) GetEdsClusters Uses

func (a *ADSC) GetEdsClusters() map[string]*xdsapi.Cluster

GetEdsClusters returns all the eds type clusters.

func (*ADSC) GetEndpoints Uses

func (a *ADSC) GetEndpoints() map[string]*xdsapi.ClusterLoadAssignment

GetEndpoints returns all the routes.

func (*ADSC) GetHTTPListeners Uses

func (a *ADSC) GetHTTPListeners() map[string]*xdsapi.Listener

GetHTTPListeners returns all the http listeners.

func (*ADSC) GetRoutes Uses

func (a *ADSC) GetRoutes() map[string]*xdsapi.RouteConfiguration

GetRoutes returns all the routes.

func (*ADSC) GetTCPListeners Uses

func (a *ADSC) GetTCPListeners() map[string]*xdsapi.Listener

GetTCPListeners returns all the tcp listeners.

func (*ADSC) Run Uses

func (a *ADSC) Run() error

Run will run the ADS client.

func (*ADSC) Save Uses

func (a *ADSC) Save(base string) error

Save will save the json configs to files, using the base directory

func (*ADSC) Send Uses

func (a *ADSC) Send(req *xdsapi.DiscoveryRequest) error

func (*ADSC) Wait Uses

func (a *ADSC) Wait(to time.Duration, updates ...string) ([]string, error)

Wait for an updates for all the specified types If updates is empty, this will wait for any update

func (*ADSC) WaitClear Uses

func (a *ADSC) WaitClear()

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

func (*ADSC) Watch Uses

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 Uses

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

    // Workload defaults to 'test'
    Workload string

    // Meta includes additional metadata for the node
    Meta *pstruct.Struct

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

    // IP is currently the primary key used to locate inbound configs. It is sent by client,
    // must match a known endpoint IP. Tests can use a ServiceEntry to register fake IPs.
    IP  string

Config for the ADS connection.

type Endpoint Uses

type Endpoint struct {
    // Weight extracted from eds
    Weight int

type TCPListener Uses

type TCPListener struct {
    // Address is the address, as expected by go Dial and Listen, including port
    Address string

    // LogFile is the access log address for the listener
    LogFile string

    // Target is the destination cluster.
    Target string

TCPListener extracts the core elements from envoy Listener.

type Target Uses

type Target struct {

    // Address is a go address, extracted from the mangled cluster name.
    Address string

    // Endpoints are the resolved endpoints from eds or cluster static.
    Endpoints map[string]Endpoint

Package adsc imports 19 packages (graph). Updated 2019-10-18. Refresh now. Tools for package owners.