forked from fabiolb/fabio
/
default.go
75 lines (72 loc) · 1.61 KB
/
default.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package config
import (
"os"
"runtime"
"time"
)
var defaultValues = struct {
ListenerValue []string
CertSourcesValue []map[string]string
ReadTimeout time.Duration
WriteTimeout time.Duration
UIListenerValue string
GZIPContentTypesValue string
}{
ListenerValue: []string{":9999"},
CertSourcesValue: []map[string]string{},
UIListenerValue: ":9998",
}
var defaultConfig = &Config{
ProfilePath: os.TempDir(),
Log: Log{
AccessFormat: "common",
RoutesFormat: "delta",
},
Metrics: Metrics{
Prefix: "{{clean .Hostname}}.{{clean .Exec}}",
Names: "{{clean .Service}}.{{clean .Host}}.{{clean .Path}}.{{clean .TargetURL.Host}}",
Interval: 30 * time.Second,
Circonus: Circonus{
APIApp: "fabio",
},
},
Proxy: Proxy{
MaxConn: 10000,
Strategy: "rnd",
Matcher: "prefix",
NoRouteStatus: 404,
DialTimeout: 30 * time.Second,
FlushInterval: time.Second,
LocalIP: LocalIPString(),
},
Registry: Registry{
Backend: "consul",
Consul: Consul{
Addr: "localhost:8500",
Scheme: "http",
KVPath: "/fabio/config",
TagPrefix: "urlprefix-",
Register: true,
ServiceAddr: ":9998",
ServiceName: "fabio",
ServiceStatus: []string{"passing"},
CheckInterval: time.Second,
CheckTimeout: 3 * time.Second,
CheckScheme: "http",
},
Timeout: 10 * time.Second,
Retry: 500 * time.Millisecond,
},
Runtime: Runtime{
GOGC: 800,
GOMAXPROCS: runtime.NumCPU(),
},
UI: UI{
Listen: Listen{
Addr: ":9998",
Proto: "http",
},
Color: "light-green",
Access: "rw",
},
}