envoytest

package
v0.0.0-...-e01fbee Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EcdsStatPrefix    = "http.ingress_http.extension_config_discovery.envoy.extension_config"
	RuntimeStatPrefix = "runtime"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvoyConfig

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

EnvoyConfig provides a configuration builder that mirrors the upstream Envoy ConfigHelper: a base configuration is used which can be modified by a series of modifiers to create the final configuration.

func NewEnvoyConfig

func NewEnvoyConfig() *EnvoyConfig

NewEnvoyConfig creates a new Envoy config builder, using a sensible default configuration that allows the provided EnvoyHandle to interact with the underlying Envoy instance.

func (*EnvoyConfig) AddCluster

func (e *EnvoyConfig) AddCluster(input string) error

AddCluster adds a cluster to the list of static clusters.

func (*EnvoyConfig) AddHTTPFilter

func (e *EnvoyConfig) AddHTTPFilter(input string) error

AddHTTPFilter adds a HTTP filter in front of the list of HTTP filters for the default listener.

func (*EnvoyConfig) AddRuntimeLayer

func (e *EnvoyConfig) AddRuntimeLayer(input string) error

AddRuntimeLayer adds a single runtime layer to the bootstrap.

func (*EnvoyConfig) Generate

func (e *EnvoyConfig) Generate() (string, error)

Generate generates the final configuration by applying all the config modifiers.

type EnvoyHandle

type EnvoyHandle struct{}

EnvoyHandle is a handle to the Envoy instance under test, providing a startup check and provides utilities for interacting with the instance.

func NewEnvoyHandle

func NewEnvoyHandle() (*EnvoyHandle, error)

NewEnvoyHandle creates a new handle for the Envoy under test after waiting for it to initialize.

func (*EnvoyHandle) EnsureControlPlaneConnectivity

func (e *EnvoyHandle) EnsureControlPlaneConnectivity(prefix string) error

EnsureControlPlaneConnectivity polls the Envoy stats endpoint to ensure that Envoy has an active request against the control plane identified by the provided stat prefix. This is useful in ensuring that Envoy has been able to reconnect to the control plane, even after the exponential backoff that happens as Envoy is unable to connect to the control plane.

func (*EnvoyHandle) MakeSimpleCall

func (e *EnvoyHandle) MakeSimpleCall() (int, error)

MakeSimpleCall issues a basic GET request to the Envoy under test, with the downstream cluster set to test-cluster.

Jump to

Keyboard shortcuts

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