Documentation ¶
Index ¶
- Constants
- func GetConfigDump(adminPort int) (*envoy_admin_v2alpha.ConfigDump, error)
- func GetConfigDumpStr(adminPort int) (string, error)
- func IsClusterPresent(cfg *envoy_admin_v2alpha.ConfigDump, clusterName string) bool
- func IsOutboundListenerPresent(cfg *envoy_admin_v2alpha.ConfigDump, listenerName string) bool
- func IsOutboundRoutePresent(cfg *envoy_admin_v2alpha.ConfigDump, clusterName string) bool
- func WaitForHealthCheckLive(adminPort int) error
- type Envoy
- type HealthCheckState
- type LogLevel
- type ServerInfo
Constants ¶
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 ¶
GetConfigDump polls Envoy admin port for the config dump and returns the response.
func GetConfigDumpStr ¶
GetConfigDumpStr polls Envoy admin port for the config dump and returns the response as a string.
func IsClusterPresent ¶
IsClusterPresent inspects the given Envoy config dump, looking for the given cluster
func IsOutboundListenerPresent ¶
IsOutboundListenerPresent inspects the given Envoy config dump, looking for the given listener.
func IsOutboundRoutePresent ¶
IsOutboundRoutePresent inspects the given Envoy config dump, looking for an outbound route which targets the given cluster.
func WaitForHealthCheckLive ¶
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 // FIXME mosn not support yaml conf JsonFile 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 NodeId string // contains filtered or unexported fields }
Envoy is a wrapper that simplifies running Envoy.
type HealthCheckState ¶
type HealthCheckState string
HealthCheckState represents a health checking state returned from /server_info
const ( // HealthCheckLive indicates Envoy is live and ready to serve requests HealthCheckLive HealthCheckState = "LIVE" // HealthCheckDraining indicates Envoy is not currently capable of serving requests HealthCheckDraining HealthCheckState = "DRAINING" )
type LogLevel ¶
type LogLevel string
LogLevel represents the log level to use for Envoy.
const ( // LogLevelTrace level LogLevelTrace LogLevel = "trace" // LogLevelDebug level LogLevelDebug LogLevel = "debug" // LogLevelInfo level LogLevelInfo LogLevel = "info" // LogLevelWarning level LogLevelWarning LogLevel = "warning" // LogLevelError level LogLevelError LogLevel = "error" // LogLevelCritical level LogLevelCritical LogLevel = "critical" // LogLevelOff level LogLevelOff = "off" )
type ServerInfo ¶
type ServerInfo struct { ProcessName string CompiledSHABuildType string HealthCheckState HealthCheckState CurrentHotRestartEpochUptime time.Duration TotalUptime time.Duration CurrentHotRestartEpoch int }
ServerInfo is the result of a request to /server_info
func GetServerInfo ¶
func GetServerInfo(adminPort int) (ServerInfo, error)
GetServerInfo returns a structure representing a call to /server_info