envoy

package
v0.0.0-...-1a56975 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// DefaultLogLevel the log level used for Envoy if not specified.
	DefaultLogLevel = LogLevelWarning

	// DefaultLogEntryPrefix the default prefix for all log lines from Envoy.
	DefaultLogEntryPrefix = "[ENVOY]"
)

Variables

This section is empty.

Functions

func GetConfigDump

func GetConfigDump(adminPort int) (*envoyAdmin.ConfigDump, error)

GetConfigDump polls Envoy admin port for the config dump and returns the response.

func GetConfigDumpStr

func GetConfigDumpStr(adminPort int) (string, error)

GetConfigDumpStr polls Envoy admin port for the config dump and returns the response as a string.

func GetServerInfo

func GetServerInfo(adminPort int) (*envoyAdmin.ServerInfo, error)

GetServerInfo returns a structure representing a call to /server_info

func IsClusterPresent

func IsClusterPresent(cfg *envoyAdmin.ConfigDump, clusterName string) bool

IsClusterPresent inspects the given Envoy config dump, looking for the given cluster

func IsOutboundListenerPresent

func IsOutboundListenerPresent(cfg *envoyAdmin.ConfigDump, listenerName string) bool

IsOutboundListenerPresent inspects the given Envoy config dump, looking for the given listener.

func IsOutboundRoutePresent

func IsOutboundRoutePresent(cfg *envoyAdmin.ConfigDump, clusterName string) bool

IsOutboundRoutePresent inspects the given Envoy config dump, looking for an outbound route which targets the given cluster.

func WaitForHealthCheckLive

func WaitForHealthCheckLive(adminPort int) error

WaitForHealthCheckLive polls the server info for Envoy and waits for it to transition to "live".

Types

type Envoy

type Envoy struct {
	// YamlFile (required) the v2 yaml config file for Envoy.
	YamlFile string
	// BinPath (optional) the path to the Envoy binary. If not set, uses the debug binary under ISTIO_OUT. If the
	// ISTIO_OUT environment variable is not set, the default location under GOPATH is assumed. If ISTIO_OUT contains
	// multiple debug binaries, the most recent file is used.
	BinPath string
	// LogFilePath (optional) Sets the output log file for Envoy. If not set, Envoy will output to stderr.
	LogFilePath string
	// LogLevel (optional) if provided, sets the log level for Envoy. If not set, DefaultLogLevel will be used.
	LogLevel LogLevel
	// LogEntryPrefix (optional) if provided, sets the prefix for every log line from this Envoy. Defaults to DefaultLogPrefix.
	LogEntryPrefix string
	// contains filtered or unexported fields
}

Envoy is a wrapper that simplifies running Envoy.

func (*Envoy) Start

func (e *Envoy) Start() (err error)

Start starts the Envoy process.

func (*Envoy) Stop

func (e *Envoy) Stop() error

Stop kills the Envoy process. TODO: separate returning of baseID, to make it work with Envoy's hot restart.

type LogLevel

type LogLevel string

LogLevel represents the log level to use for Envoy.

const (
	// LogLevelTrace level
	LogLevelTrace LogLevel = "trace"

	// LogLevelWarning level
	LogLevelWarning LogLevel = "warning"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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