envoytest

package
v3.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLoopbackAddr

func GetLoopbackAddr(ctx context.Context, port int) (string, error)

func GetLoopbackIp

func GetLoopbackIp(ctx context.Context) (string, error)

func LocalEnvoyCmd

func LocalEnvoyCmd(ctx context.Context, dockerFlags, envoyFlags []string) (*dexec.Cmd, error)

func RunEnvoy

func RunEnvoy(ctx context.Context, adsAddress string, portmaps ...string) error

RunEnvoy runs and waits on an envoy docker container that is configured to connect to the supplied ads address and expose the supplied portmaps. A Cleanup function is registered to shutdown the container at the end of the test suite.

Types

type EnvoyController

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

EnvoyController runs a go control plane for envoy that tracks ACKS/NACKS for configuration updates. This allows code to know when envoy has successfully reconfigured as well as have access to the error details when envoy is fed invalid configuration.

func NewEnvoyController

func NewEnvoyController(address string) *EnvoyController

NewEnvoyControler creates a new envoy controller that binds to the supplied address when Run.

func (*EnvoyController) Configure

func (e *EnvoyController) Configure(ctx context.Context, node, version string, snapshot ecp_v3_cache.ResourceSnapshot) (*status.Status, error)

Configure will update the envoy configuration and block until the reconfiguration either succeeds or signals an error.

func (*EnvoyController) Run

func (e *EnvoyController) Run(ctx context.Context) error

Run the ADS server.

type RequestLogger

type RequestLogger struct {
	Requests []*http.Request
}

A RequestLogger can serve HTTP on multiple ports and records all requests to .Requests for later examination.

func (*RequestLogger) ListenAndServeHTTP

func (rl *RequestLogger) ListenAndServeHTTP(ctx context.Context, addresses ...string) error

func (*RequestLogger) Log

func (rl *RequestLogger) Log(r *http.Request)

Jump to

Keyboard shortcuts

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