Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy manages an Envoy proxy process.
TODO(NET-118): properly handle the Envoy process lifecycle, including restarting crashed processes.
func NewProxy ¶
func NewProxy(cfg ProxyConfig) (*Proxy, error)
NewProxy creates a Proxy with the given configuration.
Use Run to start the Envoy proxy process.
func (*Proxy) Drain ¶ added in v1.0.4
Start draining inbound connections to the Envoy proxy process.
Note: the caller is responsible for ensuring Drain is not called concurrently with Run, as this is thread-unsafe.
func (*Proxy) DumpConfig ¶ added in v1.1.3
Dump Envoy config to disk.
func (*Proxy) Exited ¶
Exited returns a channel that is closed when the Envoy process exits. It can be used to detect and act on process crashes.
func (*Proxy) Kill ¶ added in v1.0.4
Forcefully kill the Envoy proxy process.
Note: the caller is responsible for ensuring Stop is not called concurrently with Run, as this is thread-unsafe.
func (*Proxy) Quit ¶ added in v1.0.4
Gracefully stop the Envoy proxy process.
Note: the caller is responsible for ensuring Quit is not called concurrently with Run, as this is thread-unsafe.
type ProxyConfig ¶
type ProxyConfig struct {
// ExecutablePath is the path to the Envoy executable.
//
// Defaults to whichever executable called envoy is found on $PATH.
ExecutablePath string
// AdminAddr is the hostname or IP address of the Envoy admin interface.
//
// Defaults to 127.0.0.1
AdminAddr string
// AdminBindPort is the port of the Envoy admin interface.
//
// Defaults to 19000
AdminBindPort int
// ExtraArgs are additional arguments that will be passed to Envoy.
ExtraArgs []string
// Logger that will be used to emit log messages.
//
// Note: Envoy logs are *not* written to this logger, and instead are written
// directly to EnvoyOutputStream + EnvoyErrorStream.
Logger hclog.Logger
// LogJSON determines whether the logs emitted by Envoy will be in JSON format.
LogJSON bool
// EnvoyErrorStream is the io.Writer to which the Envoy output stream will be redirected.
// Envoy writes process debug logs to the error stream.
EnvoyErrorStream io.Writer
// EnvoyOutputStream is the io.Writer to which the Envoy output stream will be redirected.
// The default Consul access log configuration write logs to the output stream.
EnvoyOutputStream io.Writer
// BootstrapConfig is the Envoy bootstrap configuration (in YAML or JSON format)
// that will be provided to Envoy via the --config-path flag.
BootstrapConfig []byte
}
ProxyConfig contains the configuration required to run an Envoy proxy.