Пример #1
0
// NewConfig returns a new Config with default settings.
func NewConfig() Config {
	return Config{
		CheckEndpoint:        "/healthcheck",
		CheckInterval:        toml.Duration(time.Second * 10),
		Enabled:              true,
		DegradeOnUnavailable: true,
		Timeout:              toml.Duration(time.Second * 5),
		RepeatTimeout:        2,
	}
}
Пример #2
0
// NewConfig returns a new Config with default settings.
func NewConfig() Config {
	return Config{
		EtcdHosts:           []string{"http://127.0.0.1:4001"},
		TTL:                 toml.Duration(time.Second * 3),
		RegistrationName:    "registrator",
		RegistrationPrefix:  "/traefik",
		LoadbalancingMethod: "drr",
		RouteByPath:         true,
		PathRoutes:          []string{"/"},
		RouteByMethod:       false,
		RouteByHost:         false,
		PassHostHeader:      true,
		CbreakerEnabled:     true,
		CbreakerExpression:  "NetworkErrorRatio() > 0.5",
		DiscoverToken:       "",
		DiscoveryEnabled:    true,
		DiscoveryRegistry:   "https://discovery.etcd.io",
	}
}