gorouter: github.com/cloudfoundry/gorouter/config Index | Files

package config

import "github.com/cloudfoundry/gorouter/config"

Index

Package Files

config.go

Constants

const (
    LOAD_BALANCE_RR           string = "round-robin"
    LOAD_BALANCE_LC           string = "least-connection"
    SHARD_ALL                 string = "all"
    SHARD_SEGMENTS            string = "segments"
    SHARD_SHARED_AND_SEGMENTS string = "shared-and-segments"
    ALWAYS_FORWARD            string = "always_forward"
    SANITIZE_SET              string = "sanitize_set"
    FORWARD                   string = "forward"
)

Variables

var AllowedForwardedClientCertModes = []string{ALWAYS_FORWARD, FORWARD, SANITIZE_SET}
var AllowedShardingModes = []string{SHARD_ALL, SHARD_SEGMENTS, SHARD_SHARED_AND_SEGMENTS}
var LoadBalancingStrategies = []string{LOAD_BALANCE_RR, LOAD_BALANCE_LC}

type AccessLog Uses

type AccessLog struct {
    File            string `yaml:"file"`
    EnableStreaming bool   `yaml:"enable_streaming"`
}

type BackendConfig Uses

type BackendConfig struct {
    ClientAuthCertificate tls.Certificate
    MaxConns              int64            `yaml:"max_conns"`
    TLSPem                `yaml:",inline"` // embed to get cert_chain and private_key for client authentication
}

type Config Uses

type Config struct {
    Status                   StatusConfig      `yaml:"status,omitempty"`
    Nats                     []NatsConfig      `yaml:"nats,omitempty"`
    Logging                  LoggingConfig     `yaml:"logging,omitempty"`
    Port                     uint16            `yaml:"port,omitempty"`
    Index                    uint              `yaml:"index,omitempty"`
    Zone                     string            `yaml:"zone,omitempty"`
    GoMaxProcs               int               `yaml:"go_max_procs,omitempty"`
    Tracing                  Tracing           `yaml:"tracing,omitempty"`
    TraceKey                 string            `yaml:"trace_key,omitempty"`
    AccessLog                AccessLog         `yaml:"access_log,omitempty"`
    DebugAddr                string            `yaml:"debug_addr,omitempty"`
    EnablePROXY              bool              `yaml:"enable_proxy,omitempty"`
    EnableSSL                bool              `yaml:"enable_ssl,omitempty"`
    SSLPort                  uint16            `yaml:"ssl_port,omitempty"`
    DisableHTTP              bool              `yaml:"disable_http,omitempty"`
    SSLCertificates          []tls.Certificate `yaml:"-"`
    TLSPEM                   []TLSPem          `yaml:"tls_pem,omitempty"`
    CACerts                  string            `yaml:"ca_certs,omitempty"`
    CAPool                   *x509.CertPool    `yaml:"-"`
    SkipSSLValidation        bool              `yaml:"skip_ssl_validation,omitempty"`
    ForwardedClientCert      string            `yaml:"forwarded_client_cert,omitempty"`
    ForceForwardedProtoHttps bool              `yaml:"force_forwarded_proto_https,omitempty"`
    SanitizeForwardedProto   bool              `yaml:"sanitize_forwarded_proto,omitempty"`
    IsolationSegments        []string          `yaml:"isolation_segments,omitempty"`
    RoutingTableShardingMode string            `yaml:"routing_table_sharding_mode,omitempty"`

    CipherString                      string             `yaml:"cipher_suites,omitempty"`
    CipherSuites                      []uint16           `yaml:"-"`
    MinTLSVersionString               string             `yaml:"min_tls_version,omitempty"`
    MinTLSVersion                     uint16             `yaml:"-"`
    ClientCertificateValidationString string             `yaml:"client_cert_validation,omitempty"`
    ClientCertificateValidation       tls.ClientAuthType `yaml:"-"`

    LoadBalancerHealthyThreshold    time.Duration `yaml:"load_balancer_healthy_threshold,omitempty"`
    PublishStartMessageInterval     time.Duration `yaml:"publish_start_message_interval,omitempty"`
    SuspendPruningIfNatsUnavailable bool          `yaml:"suspend_pruning_if_nats_unavailable,omitempty"`
    PruneStaleDropletsInterval      time.Duration `yaml:"prune_stale_droplets_interval,omitempty"`
    DropletStaleThreshold           time.Duration `yaml:"droplet_stale_threshold,omitempty"`
    PruneStaleTlsRoutes             bool          `yaml:"prune_stale_tls_routes,omitempty"`
    PublishActiveAppsInterval       time.Duration `yaml:"publish_active_apps_interval,omitempty"`
    StartResponseDelayInterval      time.Duration `yaml:"start_response_delay_interval,omitempty"`
    EndpointTimeout                 time.Duration `yaml:"endpoint_timeout,omitempty"`
    EndpointDialTimeout             time.Duration `yaml:"-"`
    RouteServiceTimeout             time.Duration `yaml:"route_services_timeout,omitempty"`
    FrontendIdleTimeout             time.Duration `yaml:"frontend_idle_timeout,omitempty"`

    RouteLatencyMetricMuzzleDuration time.Duration `yaml:"route_latency_metric_muzzle_duration,omitempty"`

    DrainWait            time.Duration `yaml:"drain_wait,omitempty"`
    DrainTimeout         time.Duration `yaml:"drain_timeout,omitempty"`
    SecureCookies        bool          `yaml:"secure_cookies,omitempty"`
    HealthCheckUserAgent string        `yaml:"healthcheck_user_agent,omitempty"`

    OAuth                      OAuthConfig      `yaml:"oauth,omitempty"`
    RoutingApi                 RoutingApiConfig `yaml:"routing_api,omitempty"`
    RouteServiceSecret         string           `yaml:"route_services_secret,omitempty"`
    RouteServiceSecretPrev     string           `yaml:"route_services_secret_decrypt_only,omitempty"`
    RouteServiceRecommendHttps bool             `yaml:"route_services_recommend_https,omitempty"`
    RouteServicesHairpinning   bool             `yaml:"route_services_hairpinning"`
    // These fields are populated by the `Process` function.
    Ip                          string        `yaml:"-"`
    RouteServiceEnabled         bool          `yaml:"-"`
    NatsClientPingInterval      time.Duration `yaml:"nats_client_ping_interval,omitempty"`
    NatsClientMessageBufferSize int           `yaml:"-"`
    Backends                    BackendConfig `yaml:"backends,omitempty"`
    ExtraHeadersToLog           []string      `yaml:"extra_headers_to_log,omitempty"`

    RouteServiceConfig RouteServiceConfig `yaml:"route_services,omitempty"`

    TokenFetcherMaxRetries                    uint32        `yaml:"token_fetcher_max_retries,omitempty"`
    TokenFetcherRetryInterval                 time.Duration `yaml:"token_fetcher_retry_interval,omitempty"`
    TokenFetcherExpirationBufferTimeInSeconds int64         `yaml:"token_fetcher_expiration_buffer_time,omitempty"`

    PidFile     string `yaml:"pid_file,omitempty"`
    LoadBalance string `yaml:"balancing_algorithm,omitempty"`

    DisableKeepAlives   bool `yaml:"disable_keep_alives"`
    MaxIdleConns        int  `yaml:"max_idle_conns,omitempty"`
    MaxIdleConnsPerHost int  `yaml:"max_idle_conns_per_host,omitempty"`

    HTTPRewrite HTTPRewrite `yaml:"http_rewrite,omitempty"`
}

func DefaultConfig Uses

func DefaultConfig() (*Config, error)

func InitConfigFromFile Uses

func InitConfigFromFile(path string) (*Config, error)

func (*Config) Initialize Uses

func (c *Config) Initialize(configYAML []byte) error

func (*Config) NatsServers Uses

func (c *Config) NatsServers() []string

func (*Config) Process Uses

func (c *Config) Process() error

func (*Config) RoutingApiEnabled Uses

func (c *Config) RoutingApiEnabled() bool

type HTTPRewrite Uses

type HTTPRewrite struct {
    Responses HTTPRewriteResponses `yaml:"responses,omitempty"`
}

type HTTPRewriteResponses Uses

type HTTPRewriteResponses struct {
    AddHeadersIfNotPresent []HeaderNameValue `yaml:"add_headers_if_not_present,omitempty"`
    RemoveHeaders          []HeaderNameValue `yaml:"remove_headers,omitempty"`
}

type HeaderNameValue Uses

type HeaderNameValue struct {
    Name  string `yaml:"name"`
    Value string `yaml:"value,omitempty"`
}

type LoggingConfig Uses

type LoggingConfig struct {
    Syslog                 string `yaml:"syslog"`
    SyslogAddr             string
    SyslogNetwork          string
    Level                  string `yaml:"level"`
    LoggregatorEnabled     bool   `yaml:"loggregator_enabled"`
    MetronAddress          string `yaml:"metron_address"`
    DisableLogForwardedFor bool   `yaml:"disable_log_forwarded_for"`
    DisableLogSourceIP     bool   `yaml:"disable_log_source_ip"`

    // This field is populated by the `Process` function.
    JobName string `yaml:"-"`
}

type NatsConfig Uses

type NatsConfig struct {
    Host string `yaml:"host"`
    Port uint16 `yaml:"port"`
    User string `yaml:"user"`
    Pass string `yaml:"pass"`
}

type OAuthConfig Uses

type OAuthConfig struct {
    TokenEndpoint     string `yaml:"token_endpoint"`
    Port              int    `yaml:"port"`
    SkipSSLValidation bool   `yaml:"skip_ssl_validation"`
    ClientName        string `yaml:"client_name"`
    ClientSecret      string `yaml:"client_secret"`
    CACerts           string `yaml:"ca_certs"`
}

type RouteServiceConfig Uses

type RouteServiceConfig struct {
    ClientAuthCertificate tls.Certificate
    TLSPem                `yaml:",inline"` // embed to get cert_chain and private_key for client authentication
}

type RoutingApiConfig Uses

type RoutingApiConfig struct {
    Uri                   string         `yaml:"uri"`
    Port                  int            `yaml:"port"`
    AuthDisabled          bool           `yaml:"auth_disabled"`
    CACerts               string         `yaml:"ca_certs"`
    CAPool                *x509.CertPool `yaml:"-"`
    ClientAuthCertificate tls.Certificate
    TLSPem                `yaml:",inline"` // embed to get cert_chain and private_key for client authentication
}

type StatusConfig Uses

type StatusConfig struct {
    Host string `yaml:"host"`
    Port uint16 `yaml:"port"`
    User string `yaml:"user"`
    Pass string `yaml:"pass"`
}

type TLSPem Uses

type TLSPem struct {
    CertChain  string `yaml:"cert_chain"`
    PrivateKey string `yaml:"private_key"`
}

type Tracing Uses

type Tracing struct {
    EnableZipkin bool `yaml:"enable_zipkin"`
}

Package config imports 10 packages (graph) and is imported by 118 packages. Updated 2019-06-25. Refresh now. Tools for package owners.