package
1.21.0-rc1
Repository: https://github.com/hashicorp/consul.git
Documentation: pkg.go.dev

# Functions

New returns a proxy with the given configuration source.
NewAgentConfigWatcher creates an AgentConfigWatcher.
NewConn returns a conn joining the two given net.Conn.
NewPublicListener returns a Listener setup to listen for public mTLS connections and proxy them to the configured local application over TCP.
NewStaticConfigWatcher returns a ConfigWatcher for a config that never changes.
NewTestTCPServer opens as a listening socket on the given address and returns a TestTCPServer serving requests to it.
NewUpstreamListener returns a Listener setup to listen locally for TCP connections that are proxied to a discovered Connect service instance.
TestEchoConn attempts to write some bytes to conn and expects to read them back within a short timeout (10ms).
TestLocalAddr makes a localhost address on the given port.
TestStaticUpstreamResolverFunc returns a function that will return a static resolver for testing UpstreamListener.
UpstreamResolverFuncFromClient returns a closure that captures a consul client and when called provides a ConsulResolver that can resolve the given UpstreamConfig using the provided api.Client dependency.

# Structs

AgentConfigWatcher watches the local Consul agent for proxy config changes.
Config is the publicly configurable state for an entire proxy instance.
Conn represents a single proxied TCP connection.
Listener is the implementation of a specific proxy listener.
Proxy implements the built-in connect proxy.
PublicListenerConfig contains the parameters needed for the incoming mTLS listener.
StaticConfigWatcher is a simple ConfigWatcher that delivers a static Config once and then never changes it.
TestTCPServer is a simple TCP echo server for use during tests.

# Interfaces

ConfigWatcher is a simple interface to allow dynamic configurations from pluggable sources.

# Type aliases

UpstreamConfig is an alias for api.Upstream so we can parse in a compatible way but define custom methods for accessing the opaque config metadata.