config

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = &Config{
	Proxy: Proxy{
		MaxConn:     10000,
		Strategy:    "rnd",
		DialTimeout: 30 * time.Second,
		LocalIP:     LocalIPString(),
	},
	Listen: []Listen{
		{
			Addr: ":9999",
		},
	},
	Consul: Consul{
		Addr:          "localhost:8500",
		KVPath:        "/fabio/config",
		TagPrefix:     "urlprefix-",
		ServiceName:   "fabio",
		CheckInterval: time.Second,
		CheckTimeout:  3 * time.Second,
	},
	Runtime: Runtime{
		GOGC:       800,
		GOMAXPROCS: runtime.NumCPU(),
	},
	UI: UI{
		Addr:  ":9998",
		Color: "light-green",
	},
}

Functions

func LocalIP added in v1.0.6

func LocalIP() (net.IP, error)

LocalIP tries to determine a non-loopback address for the local machine

func LocalIPString added in v1.0.6

func LocalIPString() string

Types

type Config

type Config struct {
	Proxy   Proxy
	Listen  []Listen
	Routes  string
	Metrics []Metrics
	Consul  Consul
	UI      UI
	Runtime Runtime
}

func FromFile

func FromFile(filename string) (*Config, error)

func FromProperties

func FromProperties(p *properties.Properties) (cfg *Config, err error)

type Consul

type Consul struct {
	Addr          string
	KVPath        string
	TagPrefix     string
	ServiceName   string
	CheckInterval time.Duration
	CheckTimeout  time.Duration
}

type Listen

type Listen struct {
	Addr           string
	KeyFile        string
	CertFile       string
	ClientAuthFile string
	TLS            bool
	ReadTimeout    time.Duration
	WriteTimeout   time.Duration
}

type Metrics

type Metrics struct {
	Target   string
	Prefix   string
	Interval time.Duration
	Addr     string
}

type Proxy

type Proxy struct {
	Strategy              string
	MaxConn               int
	ShutdownWait          time.Duration
	DialTimeout           time.Duration
	ResponseHeaderTimeout time.Duration
	KeepAliveTimeout      time.Duration
	LocalIP               string
	ClientIPHeader        string
	TLSHeader             string
	TLSHeaderValue        string
}

type Runtime

type Runtime struct {
	GOGC       int
	GOMAXPROCS int
}

type UI

type UI struct {
	Addr  string
	Color string
	Title string
}

Jump to

Keyboard shortcuts

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