config

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = &Config{
	Proxy: Proxy{
		MaxConn:       10000,
		Strategy:      "rnd",
		Matcher:       "prefix",
		NoRouteStatus: 404,
		DialTimeout:   30 * time.Second,
		LocalIP:       LocalIPString(),
	},
	Registry: Registry{
		Backend: "consul",
		Consul: Consul{
			Addr:          "localhost:8500",
			KVPath:        "/fabio/config",
			TagPrefix:     "urlprefix-",
			Register:      true,
			ServiceAddr:   ":9998",
			ServiceName:   "fabio",
			ServiceStatus: []string{"passing"},
			CheckInterval: time.Second,
			CheckTimeout:  3 * time.Second,
		},
	},
	Listen: []Listen{
		{
			Addr: ":9999",
		},
	},
	Runtime: Runtime{
		GOGC:       800,
		GOMAXPROCS: runtime.NumCPU(),
	},
	UI: UI{
		Addr:  ":9998",
		Color: "light-green",
	},
	Metrics: []Metrics{
		{
			Target:   "",
			Prefix:   "default",
			Addr:     "",
			Interval: 30 * time.Second,
		},
	},
}

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
	Registry Registry
	Listen   []Listen
	Metrics  []Metrics
	UI       UI
	Runtime  Runtime
}

func Load added in v1.1.1

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

type Consul

type Consul struct {
	Addr          string
	Token         string
	KVPath        string
	TagPrefix     string
	Register      bool
	ServiceAddr   string
	ServiceName   string
	ServiceTags   []string
	ServiceStatus []string
	CheckInterval time.Duration
	CheckTimeout  time.Duration
}

type File added in v1.1.1

type File struct {
	Path string
}

type Listen

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

type Metrics

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

type Proxy

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

type Registry added in v1.1.1

type Registry struct {
	Backend string
	Static  Static
	File    File
	Consul  Consul
}

type Runtime

type Runtime struct {
	GOGC       int
	GOMAXPROCS int
}

type Static added in v1.1.1

type Static struct {
	Routes string
}

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