envoy

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessLog

type AccessLog struct {
	Path string `json:"path"`
}

type Admin

type Admin struct {
	AccessLogPath string `json:"access_log_path"`
	ProfilePath   string `json:"profile_path,omitempty"`
	Address       string `json:"address"`
}

type CDS

type CDS struct {
	Cluster        `json:"cluster"`
	RefreshDelayMs int `json:"refresh_delay_ms"`
}

type Cluster

type Cluster struct {
	Name                          string `json:"name"`
	Type                          string `json:"type"`
	ConnectTimeoutMs              int    `json:"connect_timeout_ms"`
	PerConnectionBufferLimitBytes int    `json:"per_connection_buffer_limit_bytes,omitempty"`
	LBType                        string `json:"lb_type"`
	Hosts                         []Host `json:"hosts,omitempty"`
	ServiceName                   string `json:"service_name,omitempty"`
	// *HealthCheck                  `json:"health_check,omitempty"`
	MaxRequestsPerConnection int `json:"max_requests_per_connection,omitempty"`
}

type ClusterCache

type ClusterCache interface {
	// Values returns a copy of the contents of the cache.
	Values() []*v2.Cluster

	// Add adds an entry to the cache. If a Cluster with the same
	// name exists, it is replaced.
	Add(*v2.Cluster)

	// Remove removes the named entry from the cache. If the entry
	// is not present in the cache, the operation is a no-op.
	Remove(string)
}

ClusterCache represents a cache of computed *v2.Cluster objects.

func NewClusterCache

func NewClusterCache() ClusterCache

NewClusterCache returns a new ClusterCache.

type ClusterLoadAssignmentCache

type ClusterLoadAssignmentCache interface {
	// Values returns a copy of the contents of the cache.
	Values() []*v2.ClusterLoadAssignment

	// Add adds an entry to the cache. If a ClusterLoadAssignment with the same
	// name exists, it is replaced.
	Add(*v2.ClusterLoadAssignment)

	// Remove removes the named entry from the cache. If the entry
	// is not present in the cache, the operation is a no-op.
	Remove(string)
}

ClusterLoadAssignemntCache represents a cache of computed *v2.ClusterLoadAssignment objects.

func NewClusterLoadAssignmentCache

func NewClusterLoadAssignmentCache() ClusterLoadAssignmentCache

NewClusterLoadAssignmentCache returns a new ClusterLoadAssignmentCache.

type ClusterLoadAssignmentHandler

type ClusterLoadAssignmentHandler struct {
	ClusterLoadAssignmentCache
	log.Logger
}

type ClusterManager

type ClusterManager struct {
	Clusters          []*Cluster `json:"clusters"`
	*SDS              `json:"sds,omitempty"`
	LocalClusterName  string `json:"local_cluster_namei,omitempty"`
	*OutlierDetection `json:"outlier_detection,omitempty"`
	*CDS              `json:"cds,omitempty"`
}

type Config

type Config struct {
	Listeners                  []*Listener `json:"listeners"`
	*LDS                       `json:"lds,omitempty"`
	*Admin                     `json:"admin,omitempty"`
	ClusterManager             `json:"cluster_manager"`
	FlagsPath                  string `json:"flags_path,omitempty"`
	StatsdUDPIPAddress         string `json:"statsd_udp_ip_address,omitempty"`
	StatsdTCPClusterName       string `json:"statsd_tcp_cluster_name,omitempty"`
	StatsdFlushIntervalMs      string `json:"stats_flush_interval_ms,omitempty"`
	WatchdogMissTimeoutMs      string `json:"watchdog_miss_timeout_ms,omitempty"`
	WatchdogMegamissTimeoutMs  string `json:"watchdog_megamiss_timeout_ms,omitempty"`
	WatchdogKillTimeoutMs      string `json:"watchdog_kill_timeout_ms,omitempty"`
	WatchdogMultikillTimeoutMs string `json:"watchdog_multikill_timeout_ms,omitempty"`
	*Tracing                   `json:"tracing,omitempty"`
	*RateLimitService          `json:"rate_limit_service,omitempty"`
	*Runtime                   `json:"runtime,omitempty"`
}

Config is the top level Envoy configuration.

type ConfigWriter

type ConfigWriter struct {

	// AdminAccessLogPath is the path to write the access log for the administration server.
	// Defaults to /dev/null.
	AdminAccessLogPath string

	// AdminAddress is the TCP address that the administration server will listen on.
	// Defaults to 127.0.0.1.
	AdminAddress string

	// AdminPort is the port that the administration server will listen on.
	// Defaults to 9001.
	AdminPort int

	// XDSAddress is the TCP address of the XDS management server. For JSON configurations
	// this is the address of the v1 REST API server. For YAML configurations this is the
	// address of the v2 gRPC management server.
	// Defaults to 127.0.0.1.
	XDSAddress string

	// XDSRESTPort is the management server port that provides the v1 REST API.
	// Defaults to 8000.
	XDSRESTPort int

	// XDSGRPCPort is the management server port that provides the v2 gRPC API.
	// Defaults to 8001.
	XDSGRPCPort int
}

A ConfigWriter knows how to write a bootstap Envoy configuration in both JSON and YAML formats.

func (*ConfigWriter) WriteJSON

func (c *ConfigWriter) WriteJSON(w io.Writer) error

WriteJSON writes the configuration to the supplied writer in JSON v1 format. If the supplied io.Writer is a file, it should end with a .json extension.

func (*ConfigWriter) WriteYAML

func (c *ConfigWriter) WriteYAML(w io.Writer) error

WriteYAML writes the configuration to the supplied writer in YAML v2 format. If the supplied io.Writer is a file, it should end with a .yaml extension.

type Filter

type Filter interface {
}

type Host

type Host struct {
	URL string `json:"url"`
}

type HttpConnectionManager

type HttpConnectionManager struct {
	Type   string                      `json:"type"` // must be "read"
	Name   string                      `json:"name"` // must be "http_connection_manager"
	Config HttpConnectionManagerConfig `json:"config"`
}

type HttpConnectionManagerConfig

type HttpConnectionManagerConfig struct {
	CodecType    string `json:"codec_type"` // one of http1, http2, auto
	StatPrefix   string `json:"stat_prefix"`
	*RDS         `json:"rds,omitempty"`
	*RouteConfig `json:"route_config,omitempty"`
	Filters      []Filter `json:"filters"`
	AddUserAgent bool     `json:"add_user_agent,omitempty"`
	*Tracing     `json:"tracing,omitempty"`
	// "http1_settings": "{...}",
	// "http2_settings": "{...}",
	ServerName         string      `json:"server_name,omitempty"` // defaults to "envoy"
	IdleTimeoutSeconds int         `json:"idle_timeout_s,omitempty"`
	DrainTimeoutMs     int         `json:"drain_timeout_ms,omitempty"`
	AccessLog          []AccessLog `json:"access_log,omitempty"`
	UseRemoteAddress   bool        `json:"use_remote_address,omitempty"`
	ForwardClientCert  string      `json:"forward_client_cert,omitempty"`
	// "set_current_client_cert": "...",
	GenerateRequestID bool `json:"generate_request_id,omitempty"`
}

type IngressResourceHandler

type IngressResourceHandler struct {
	VirtualHostCache
	log.Logger
}

type LDS

type LDS struct {
	Cluster        string `json:"cluster"`
	RefreshDelayMs string `json:"refresh_delay_ms"`
}

type Listener

type Listener struct {
	Name                          string      `json:"name,omitempty"`
	Address                       string      `json:"address"`
	Filters                       []Filter    `json:"filters"`
	SSLContext                    *SSLContext `json:"ssl_context,omitempty"`
	BindToPort                    string      `json:"bind_to_port,omitempty"`                      // bool, defaults to "true"
	UseProxyProto                 string      `json:"use_proxy_proto,omitempty"`                   // bool, defaults to "false"
	UseOriginalDest               string      `json:"use_original_dst,omitempty"`                  // bool, defaults to "false"
	PerConnectionBufferLimitBytes string      `json:"per_connection_buffer_limit_bytes,omitempty"` // integer, defaults to 1MiB
}

type ListenerCache

type ListenerCache chan []*v2.Listener

ListenerCache is a thread safe, atomic, copy on write cache of v2.Listener objects.

func (ListenerCache) Values

func (lc ListenerCache) Values() []*v2.Listener

type OutlierDetection

type OutlierDetection struct {
	EventLogPath string `json:"event_log_path,omitempty"`
}

type RDS

type RDS struct {
	Cluster         string `json:"cluster"`
	RouteConfigName string `json:"route_config_name"`
	RefreshDelayMs  int    `json:"refresh_delay_ms"`
}

type RateLimitService

type RateLimitService struct {
}

type Route

type Route struct {
	Prefix        string `json:"prefix,omitempty"`
	Path          string `json:"path,omitempty"`
	Regex         string `json:"regex,omitempty"`
	Cluster       string `json:"cluster,omitempty"`
	ClusterHeader string `json:"cluster_header,omitempty"`
	// "weighted_clusters" : "{...}",
	HostRedirect    string `json:"host_redirect,omitempty"`
	PathRedirect    string `json:"path_redirect,omitempty"`
	PrefixRewrite   string `json:"prefix_rewrite,omitempty"`
	HostRewrite     string `json:"host_rewrite,omitempty"`
	AutoHostRewrite bool   `json:"auto_host_rewrite,omitempty"`
	// "case_sensitive": "...",
	UseWebsocket bool `json:"use_websocket,omitempty"`
	TimeoutMS    int  `json:"timeout_ms,omitempty"`
	// "runtime": "{...}",
	// "retry_policy": "{...}",
	// "shadow": "{...}",
	Priority string `json:"priority,omitempty"`
}

type RouteConfig

type RouteConfig struct {
	ValidateClusters bool           `json:"validate_clusters,omitempty"`
	VirtualHosts     []*VirtualHost `json:"virtual_hosts"`
}

type Router

type Router struct {
	Type   string       `json:"type"` // must be "decoder"
	Name   string       `json:"name"` // must be "router"
	Config RouterConfig `json:"config"`
}

type RouterConfig

type RouterConfig struct {
	DynamicStats bool `json:"dynamic_stats,omitempty"`
}

type Runtime

type Runtime struct {
}

type SDS

type SDS struct {
	Cluster        `json:"cluster"`
	RefreshDelayMs int `json:"refresh_delay_ms"`
}

type SDSHost

type SDSHost struct {
	IPAddress string `json:"ip_address"`
	Port      int    `json:"port"`
	Tags      struct {
		AZ                  string `json:"az,omitempty"`
		Canary              bool   `json:"canary,omitempty"`
		LoadBalancingWeight int    `json:"load_balancing_weight,omitempty"`
	} `json:"tags"`
}

type SSLContext

type SSLContext struct {
}

type Tracing

type Tracing struct {
}

type Translator

Translator receives notifications from the Kubernetes API and translates those objects into additions and removals entries of Envoy gRPC objects from a cache.

func (*Translator) OnAdd

func (t *Translator) OnAdd(obj interface{})

func (*Translator) OnDelete

func (t *Translator) OnDelete(obj interface{})

func (*Translator) OnUpdate

func (t *Translator) OnUpdate(oldObj, newObj interface{})

type VirtualHost

type VirtualHost struct {
	Name       string   `json:"name"`
	Domains    []string `json:"domains"`
	Routes     []Route  `json:"routes"`
	RequireSSL string   `json:"require_ssl,omitempty"`
}

func (*VirtualHost) AddDomain

func (v *VirtualHost) AddDomain(d string)

func (*VirtualHost) AddRoute

func (v *VirtualHost) AddRoute(r Route)

type VirtualHostCache

type VirtualHostCache interface {
	// Values returns a copy of the contents of the cache.
	Values() []*v2.VirtualHost

	// Add adds an entry to the cache. If a VirtualHost with the same
	// name exists, it is replaced.
	Add(*v2.VirtualHost)

	// Remove removes the named entry from the cache. If the entry
	// is not present in the cache, the operation is a no-op.
	Remove(string)
}

VirtualHostCache represents a cache of computed *v2.VirtualHost objects.

func NewVirtualHostCache

func NewVirtualHostCache() VirtualHostCache

NewVirtualHostCache returns a new VirtualHostCache.

Jump to

Keyboard shortcuts

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