config

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2019 License: Apache-2.0, MIT Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ConfigFile string

	// generic:
	Address                         string         `yaml:"address"`
	IgnoreTrailingSlash             bool           `yaml:"ignore-trailing-slash"`
	Insecure                        bool           `yaml:"insecure"`
	ProxyPreserveHost               bool           `yaml:"proxy-preserve-host"`
	DevMode                         bool           `yaml:"dev-mode"`
	SupportListener                 string         `yaml:"support-listener"`
	DebugListener                   string         `yaml:"debug-listener"`
	CertPathTLS                     string         `yaml:"tls-cert"`
	KeyPathTLS                      string         `yaml:"tls-key"`
	PrintVersion                    bool           `yaml:"version"`
	MaxLoopbacks                    int            `yaml:"max-loopbacks"`
	DefaultHTTPStatus               int            `yaml:"default-http-status"`
	PluginDir                       string         `yaml:"plugindir"`
	LoadBalancerHealthCheckInterval time.Duration  `yaml:"lb-healthcheck-interval"`
	ReverseSourcePredicate          bool           `yaml:"reverse-source-predicate"`
	RemoveHopHeaders                bool           `yaml:"remove-hop-headers"`
	RfcPatchPath                    bool           `yaml:"rfc-patch-path"`
	MaxAuditBody                    int            `yaml:"max-audit-body"`
	EnableBreakers                  bool           `yaml:"enable-breakers"`
	Breakers                        breakerFlags   `yaml:"breaker"`
	EnableRatelimiters              bool           `yaml:"enable-ratelimits"`
	Ratelimits                      ratelimitFlags `yaml:"ratelimits"`
	EnableRouteLIFOMetrics          bool           `yaml:"enable-route-lifo-metrics"`
	MetricsFlavour                  *listFlag      `yaml:"metrics-flavour"`
	FilterPlugins                   *pluginFlag    `yaml:"filter-plugin"`
	PredicatePlugins                *pluginFlag    `yaml:"predicate-plugin"`
	DataclientPlugins               *pluginFlag    `yaml:"dataclient-plugin"`
	MultiPlugins                    *pluginFlag    `yaml:"multi-plugin"`

	// logging, metrics, tracing:
	EnablePrometheusMetrics             bool      `yaml:"enable-prometheus-metrics"`
	OpenTracing                         string    `yaml:"opentracing"`
	OpenTracingInitialSpan              string    `yaml:"opentracing-initial-span"`
	OpenTracingExcludedProxyTags        string    `yaml:"opentracing-excluded-proxy-tags"`
	OpentracingLogFilterLifecycleEvents bool      `yaml:"opentracing-log-filter-lifecycle-events"`
	OpentracingLogStreamEvents          bool      `yaml:"opentracing-log-stream-events"`
	MetricsListener                     string    `yaml:"metrics-listener"`
	MetricsPrefix                       string    `yaml:"metrics-prefix"`
	EnableProfile                       bool      `yaml:"enable-profile"`
	DebugGcMetrics                      bool      `yaml:"debug-gc-metrics"`
	RuntimeMetrics                      bool      `yaml:"runtime-metrics"`
	ServeRouteMetrics                   bool      `yaml:"serve-route-metrics"`
	ServeHostMetrics                    bool      `yaml:"serve-host-metrics"`
	BackendHostMetrics                  bool      `yaml:"backend-host-metrics"`
	AllFiltersMetrics                   bool      `yaml:"all-filters-metrics"`
	CombinedResponseMetrics             bool      `yaml:"combined-response-metrics"`
	RouteResponseMetrics                bool      `yaml:"route-response-metrics"`
	RouteBackendErrorCounters           bool      `yaml:"route-backend-error-counters"`
	RouteStreamErrorCounters            bool      `yaml:"route-stream-error-counters"`
	RouteBackendMetrics                 bool      `yaml:"route-backend-metrics"`
	RouteCreationMetrics                bool      `yaml:"route-creation-metrics"`
	MetricsUseExpDecaySample            bool      `yaml:"metrics-exp-decay-sample"`
	HistogramMetricBucketsString        string    `yaml:"histogram-metric-buckets"`
	HistogramMetricBuckets              []float64 `yaml:"-"`
	DisableMetricsCompat                bool      `yaml:"disable-metrics-compat"`
	ApplicationLog                      string    `yaml:"application-log"`
	ApplicationLogLevel                 log.Level `yaml:"-"`
	ApplicationLogLevelString           string    `yaml:"application-log-level"`
	ApplicationLogPrefix                string    `yaml:"application-log-prefix"`
	AccessLog                           string    `yaml:"access-log"`
	AccessLogDisabled                   bool      `yaml:"access-log-disabled"`
	AccessLogJSONEnabled                bool      `yaml:"access-log-json-enabled"`
	AccessLogStripQuery                 bool      `yaml:"access-log-strip-query"`
	SuppressRouteUpdateLogs             bool      `yaml:"suppress-route-update-logs"`

	// route sources:
	EtcdUrls                  string               `yaml:"etcd-urls"`
	EtcdPrefix                string               `yaml:"etcd-prefix"`
	EtcdTimeout               time.Duration        `yaml:"etcd-timeout"`
	EtcdInsecure              bool                 `yaml:"etcd-insecure"`
	EtcdOAuthToken            string               `yaml:"etcd-oauth-token"`
	EtcdUsername              string               `yaml:"etcd-username"`
	EtcdPassword              string               `yaml:"etcd-password"`
	InnkeeperURL              string               `yaml:"innkeeper-url"`
	InnkeeperAuthToken        string               `yaml:"innkeeper-auth-token"`
	InnkeeperPreRouteFilters  string               `yaml:"innkeeper-pre-route-filters"`
	InnkeeperPostRouteFilters string               `yaml:"innkeeper-post-route-filters"`
	RoutesFile                string               `yaml:"routes-file"`
	InlineRoutes              string               `yaml:"inline-routes"`
	AppendFilters             *defaultFiltersFlags `yaml:"default-filters-append"`
	PrependFilters            *defaultFiltersFlags `yaml:"default-filters-prepend"`
	SourcePollTimeout         int64                `yaml:"source-poll-timeout"`
	WaitFirstRouteLoad        bool                 `yaml:"wait-first-route-load"`

	// Kubernetes:
	KubernetesIngress           bool                `yaml:"kubernetes"`
	KubernetesInCluster         bool                `yaml:"kubernetes-in-cluster"`
	KubernetesURL               string              `yaml:"kubernetes-url"`
	KubernetesHealthcheck       bool                `yaml:"kubernetes-healthcheck"`
	KubernetesHTTPSRedirect     bool                `yaml:"kubernetes-https-redirect"`
	KubernetesHTTPSRedirectCode int                 `yaml:"kubernetes-https-redirect-code"`
	KubernetesIngressClass      string              `yaml:"kubernetes-ingress-class"`
	WhitelistedHealthCheckCIDR  string              `yaml:"whitelisted-healthcheck-cidr"`
	KubernetesPathModeString    string              `yaml:"kubernetes-path-mode"`
	KubernetesPathMode          kubernetes.PathMode `yaml:"-"`
	KubernetesNamespace         string              `yaml:"kubernetes-namespace"`
	KubernetesEnableEastWest    bool                `yaml:"enable-kubernetes-east-west"`
	KubernetesEastWestDomain    string              `yaml:"kubernetes-east-west-domain"`

	// Default filters
	DefaultFiltersDir string `yaml:"default-filters-dir"`

	// Auth:
	OauthURL                        string        `yaml:"oauth-url"`
	OauthScope                      string        `yaml:"oauth-scope"`
	OauthCredentialsDir             string        `yaml:"oauth-credentials-dir"`
	Oauth2TokeninfoURL              string        `yaml:"oauth2-tokeninfo-url"`
	Oauth2TokeninfoTimeout          time.Duration `yaml:"oauth2-tokeninfo-timeout"`
	Oauth2TokenintrospectionTimeout time.Duration `yaml:"oauth2-tokenintrospect-timeout"`
	WebhookTimeout                  time.Duration `yaml:"webhook-timeout"`
	OidcSecretsFile                 string        `yaml:"oidc-secrets-file"`
	CredentialPaths                 *listFlag     `yaml:"credentials-paths"`
	CredentialsUpdateInterval       time.Duration `yaml:"credentials-update-interval"`

	// TLS client certs
	ClientKeyFile  string            `yaml:"client-tls-key"`
	ClientCertFile string            `yaml:"client-tls-cert"`
	Certificates   []tls.Certificate `yaml:"-"`

	// API Monitoring
	ApiUsageMonitoringEnable                       bool   `yaml:"enable-api-usage-monitoring"`
	ApiUsageMonitoringRealmKeys                    string `yaml:"api-usage-monitoring-realm-keys"`
	ApiUsageMonitoringClientKeys                   string `yaml:"api-usage-monitoring-client-keys"`
	ApiUsageMonitoringDefaultClientTrackingPattern string `yaml:"api-usage-monitoring-default-client-tracking-pattern"`
	ApiUsageMonitoringRealmsTrackingPattern        string `yaml:"api-usage-monitoring-realms-tracking-pattern"`

	// connections, timeouts:
	WaitForHealthcheckInterval   time.Duration `yaml:"wait-for-healthcheck-interval"`
	IdleConnsPerHost             int           `yaml:"idle-conns-num"`
	CloseIdleConnsPeriod         time.Duration `yaml:"close-idle-conns-period"`
	BackendFlushInterval         time.Duration `yaml:"backend-flush-interval"`
	ExperimentalUpgrade          bool          `yaml:"experimental-upgrade"`
	ExperimentalUpgradeAudit     bool          `yaml:"experimental-upgrade-audit"`
	ReadTimeoutServer            time.Duration `yaml:"read-timeout-server"`
	ReadHeaderTimeoutServer      time.Duration `yaml:"read-header-timeout-server"`
	WriteTimeoutServer           time.Duration `yaml:"write-timeout-server"`
	IdleTimeoutServer            time.Duration `yaml:"idle-timeout-server"`
	MaxHeaderBytes               int           `yaml:"max-header-bytes"`
	EnableConnMetricsServer      bool          `yaml:"enable-connection-metrics"`
	TimeoutBackend               time.Duration `yaml:"timeout-backend"`
	KeepaliveBackend             time.Duration `yaml:"keepalive-backend"`
	EnableDualstackBackend       bool          `yaml:"enable-dualstack-backend"`
	TlsHandshakeTimeoutBackend   time.Duration `yaml:"tls-timeout-backend"`
	ResponseHeaderTimeoutBackend time.Duration `yaml:"response-header-timeout-backend"`
	ExpectContinueTimeoutBackend time.Duration `yaml:"expect-continue-timeout-backend"`
	MaxIdleConnsBackend          int           `yaml:"max-idle-connection-backend"`

	// swarm:
	EnableSwarm bool `yaml:"enable-swarm"`
	// redis based
	SwarmRedisURLs         *listFlag     `yaml:"swarm-redis-urls"`
	SwarmRedisReadTimeout  time.Duration `yaml:"swarm-redis-read-timeout"`
	SwarmRedisWriteTimeout time.Duration `yaml:"swarm-redis-write-timeout"`
	SwarmRedisPoolTimeout  time.Duration `yaml:"swarm-redis-pool-timeout"`
	SwarmRedisMinConns     int           `yaml:"swarm-redis-min-conns"`
	SwarmRedisMaxConns     int           `yaml:"swarm-redis-max-conns"`
	// swim based
	SwarmKubernetesNamespace          string        `yaml:"swarm-namespace"`
	SwarmKubernetesLabelSelectorKey   string        `yaml:"swarm-label-selector-key"`
	SwarmKubernetesLabelSelectorValue string        `yaml:"swarm-label-selector-value"`
	SwarmPort                         int           `yaml:"swarm-port"`
	SwarmMaxMessageBuffer             int           `yaml:"swarm-max-msg-buffer"`
	SwarmLeaveTimeout                 time.Duration `yaml:"swarm-leave-timeout"`
	SwarmStaticSelf                   string        `yaml:"swarm-static-self"`
	SwarmStaticOther                  string        `yaml:"swarm-static-other"`
}

func NewConfig

func NewConfig() *Config

func (*Config) Parse

func (c *Config) Parse() error

func (*Config) ToOptions

func (c *Config) ToOptions() skipper.Options

Jump to

Keyboard shortcuts

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