config

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2018 License: Apache-2.0 Imports: 9 Imported by: 10

Documentation

Index

Constants

View Source
const (
	LOAD_BALANCE_RR string = "round-robin"
	LOAD_BALANCE_LC string = "least-connection"
)

Variables

View Source
var DefaultTier2IPRange = "172.0.0.0/24"

DefaultTier2IPRange is the default tier2 virtual server IP range

View Source
var LoadBalancingStrategies = []string{LOAD_BALANCE_RR, LOAD_BALANCE_LC}

Functions

This section is empty.

Types

type AccessLog

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

type BigIPConfig

type BigIPConfig struct {
	URL               string   `yaml:"url" json:"url"`
	User              string   `yaml:"user" json:"username"`
	Pass              string   `yaml:"pass" json:"password"`
	Partitions        []string `yaml:"partition" json:"partitions"`
	LoadBalancingMode string   `yaml:"load_balancing_mode" json:"-"`
	VerifyInterval    int      `yaml:"verify_interval" json:"-"`
	ExternalAddr      string   `yaml:"external_addr" json:"-"`
	SSLProfiles       []string `yaml:"ssl_profiles" json:"-"`
	Policies          []string `yaml:"policies" json:"-"`
	Profiles          []string `yaml:"profiles" json:"-"`
	HealthMonitors    []string `yaml:"health_monitors" json:"-"`
	DriverCmd         string   `yaml:"driver_path" json:"-"`
	Tier2IPRange      string   `yaml:"tier2_ip_range" json:"-"`
}

BigIPConfig configuration parameters for bigip integration

type Config

type Config struct {
	BigIP                    BigIPConfig         `yaml:"bigip"`
	Status                   StatusConfig        `yaml:"status"`
	Broker                   ServiceBrokerConfig `yaml:"broker"`
	Nats                     []NatsConfig        `yaml:"nats"`
	Logging                  LoggingConfig       `yaml:"logging"`
	Port                     uint16              `yaml:"port"`
	Index                    uint                `yaml:"index"`
	Zone                     string              `yaml:"zone"`
	GoMaxProcs               int                 `yaml:"go_max_procs,omitempty"`
	Tracing                  Tracing             `yaml:"tracing"`
	TraceKey                 string              `yaml:"trace_key"`
	AccessLog                AccessLog           `yaml:"access_log"`
	EnableAccessLogStreaming bool                `yaml:"enable_access_log_streaming"`
	DebugAddr                string              `yaml:"debug_addr"`
	EnablePROXY              bool                `yaml:"enable_proxy"`
	EnableSSL                bool                `yaml:"enable_ssl"`
	SSLPort                  uint16              `yaml:"ssl_port"`
	SSLCertPath              string              `yaml:"ssl_cert_path"`
	SSLKeyPath               string              `yaml:"ssl_key_path"`
	SSLCertificate           tls.Certificate
	SkipSSLValidation        bool `yaml:"skip_ssl_validation"`
	ForceForwardedProtoHttps bool `yaml:"force_forwarded_proto_https"`

	CipherString string `yaml:"cipher_suites"`
	CipherSuites []uint16

	LoadBalancerHealthyThreshold    time.Duration `yaml:"load_balancer_healthy_threshold"`
	PublishStartMessageInterval     time.Duration `yaml:"publish_start_message_interval"`
	SuspendPruningIfNatsUnavailable bool          `yaml:"suspend_pruning_if_nats_unavailable"`
	PruneStaleDropletsInterval      time.Duration `yaml:"prune_stale_droplets_interval"`
	DropletStaleThreshold           time.Duration `yaml:"droplet_stale_threshold"`
	PublishActiveAppsInterval       time.Duration `yaml:"publish_active_apps_interval"`
	StartResponseDelayInterval      time.Duration `yaml:"start_response_delay_interval"`
	EndpointTimeout                 time.Duration `yaml:"endpoint_timeout"`
	RouteServiceTimeout             time.Duration `yaml:"route_services_timeout"`
	RouteMode                       string        `yaml:"route_mode"`
	BrokerMode                      bool          `yaml:"broker_mode"`
	RoutingMode                     RoutingMode

	DrainWait          time.Duration `yaml:"drain_wait,omitempty"`
	DrainTimeout       time.Duration `yaml:"drain_timeout,omitempty"`
	SecureCookies      bool          `yaml:"secure_cookies"`
	RouterGroupName    string        `yaml:"router_group"`
	TCPRouterGroupName string        `yaml:"tcp_router_group"`

	OAuth                      OAuthConfig      `yaml:"oauth"`
	RoutingApi                 RoutingApiConfig `yaml:"routing_api"`
	RouteServiceSecret         string           `yaml:"route_services_secret"`
	RouteServiceSecretPrev     string           `yaml:"route_services_secret_decrypt_only"`
	RouteServiceRecommendHttps bool             `yaml:"route_services_recommend_https"`
	// These fields are populated by the `Process` function.
	Ip                     string        `yaml:"-"`
	RouteServiceEnabled    bool          `yaml:"-"`
	NatsClientPingInterval time.Duration `yaml:"-"`

	ExtraHeadersToLog []string `yaml:"extra_headers_to_log"`

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

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

	SessionPersistence bool `yaml:"session_persistence"`

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

func DefaultConfig

func DefaultConfig() *Config

func InitConfigFromFile

func InitConfigFromFile(path string) *Config

func (*Config) Initialize

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

func (*Config) NatsServers

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

func (*Config) Process

func (c *Config) Process()

func (*Config) RoutingApiEnabled

func (c *Config) RoutingApiEnabled() bool

type LoggingConfig

type LoggingConfig struct {
	Syslog             string `yaml:"syslog"`
	Level              string `yaml:"level"`
	LoggregatorEnabled bool   `yaml:"loggregator_enabled"`
	MetronAddress      string `yaml:"metron_address"`

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

type NatsConfig

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

type OAuthConfig

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 RoutingApiConfig

type RoutingApiConfig struct {
	Uri          string `yaml:"uri"`
	Port         int    `yaml:"port"`
	AuthDisabled bool   `yaml:"auth_disabled"`
}

type RoutingMode

type RoutingMode int

RoutingMode of controller

const (
	// TCP only routing mode
	TCP RoutingMode = iota
	// HTTP only routing mode
	HTTP
)

func (RoutingMode) String

func (rm RoutingMode) String() string

type ServiceBrokerConfig added in v1.1.0

type ServiceBrokerConfig struct {
	ID               string
	Name             string
	Description      string
	DisplayName      string
	LongDescription  string
	DocumentationURL string
	SupportURL       string
	ImageURL         string
	ProviderName     string
}

ServiceBrokerConfig configuration parameters

type StatusConfig

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

type Tracing

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

Jump to

Keyboard shortcuts

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