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) Exited ¶
func (p *Proxy) Exited() chan struct{}
Exited returns a channel that is closed when the Envoy process exits. It can be used to detect and act on process crashes.
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
// 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.
Click to show internal directories.
Click to hide internal directories.