ads

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IgnoreHostNotFound

func IgnoreHostNotFound(err error) error

IgnoreHostNotFound returns nil if the root cause of the given err is of type HostNotFoundError, otherwise returns the original err

Types

type Client

type Client interface {
	GetHTTPClientPropertiesByHost(ctx context.Context, address string) (<-chan HTTPClientPropertiesResponse, error)
	GetTCPClientPropertiesByHost(ctx context.Context, address string) (<-chan ClientPropertiesResponse, error)
	GetListenerProperties(ctx context.Context, address string) (<-chan ListenerPropertiesResponse, error)

	// SetSearchDomains updates the search domain list specified at creation with domains
	SetSearchDomains(domains []string)

	// GetSearchDomains returns the currently configured search domain list for this client
	GetSearchDomains() []string

	// IncrementActiveRequestsCount increments the active requests count for the endpoint given its address.
	// Should be invoked when a connection is successfully established to the endpoint and a request is sent to it.
	IncrementActiveRequestsCount(address string)

	// DecrementActiveRequestsCount decrements the active requests count for the endpoint given its address
	// Should be invoked when the endpoint finished processing a request
	DecrementActiveRequestsCount(address string)
}

Client knows how to interact with a Management server through ADS API over gRPC stream using either SotW or the incremental variant (see: https://www.envoyproxy.io/docs/envoy/latest/api-docs/xds_protocol#four-variants) of the xDS protocol to provide resource configurations received from the management server to consumer applications.

func Connect

func Connect(ctx context.Context, config *config.ClientConfig) (Client, error)

type ClientProperties

type ClientProperties interface {
	// Address returns the address of the endpoint
	Address() (net.Addr, error)

	// UseTLS returns true if the target service accept TLS traffic
	UseTLS() bool

	// Permissive returns true if the target service accepts both TLS and plaintext traffic
	Permissive() bool

	// ServerName returns the SNI of the target HTTP service when connection to one of its endpoints
	// is made through TLS
	ServerName() string

	// Metadata returns the metadata associated with the target service
	Metadata() map[string]interface{}
}

ClientProperties represents the properties for a workload to connect to a target service

type ClientPropertiesResponse

type ClientPropertiesResponse interface {
	ClientProperties() ClientProperties

	// Error in case retrieving ClientProperties failed returns the error causing the failure
	Error() error
}

ClientPropertiesResponse contains the result for the API call to retrieve ClientProperties for a given destination TCP service.

type HTTPClientPropertiesResponse

type HTTPClientPropertiesResponse interface {
	ClientProperties() ClientProperties

	// Error in case retrieving HTTPClientProperties failed returns the error causing the failure
	Error() error
}

HTTPClientPropertiesResponse contains the result for the API call to retrieve HTTPClientProperties for a given destination HTTP service.

type HostNotFoundError

type HostNotFoundError struct {
	HostName string
}

HostNotFoundError is returned when the given host name is not found in Istio's NDS

func (*HostNotFoundError) Error

func (e *HostNotFoundError) Error() string

func (*HostNotFoundError) Is

func (e *HostNotFoundError) Is(target error) bool

type ListenerProperties

type ListenerProperties interface {
	// UseTLS returns true if the workload accepts TLS traffic
	UseTLS() bool

	// Permissive returns true if the workload accepts both plaintext and TLS traffic
	Permissive() bool

	// IsClientCertificateRequired returns true if client certificate is required
	IsClientCertificateRequired() bool

	// Metadata returns the metadata associated with this listener
	Metadata() map[string]interface{}
}

ListenerProperties represents the properties of a listener of a workload

type ListenerPropertiesResponse

type ListenerPropertiesResponse interface {
	ListenerProperties() ListenerProperties
	// Error in case retrieving ListenerProperties failed returns the error causing the failure
	Error() error
}

ListenerPropertiesResponse contains the result for the API call to retrieve ListenerProperties for a given address.

type NoEndpointFoundError

type NoEndpointFoundError struct{}

NoEndpointFoundError is returned when no service endpoint can be selected either due to there is no healthy endpoint or according to the load balancing weight no endpoint that accepts traffic can be selected

func (*NoEndpointFoundError) Error

func (e *NoEndpointFoundError) Error() string

func (*NoEndpointFoundError) Is

func (e *NoEndpointFoundError) Is(target error) bool

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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