-
Notifications
You must be signed in to change notification settings - Fork 9
/
config.go
51 lines (46 loc) · 1.62 KB
/
config.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
package main
import (
"sync"
)
// Main configuration object. This contains all variables and is passed to
// the templating engine.
type Config struct {
Backends map[string]*Backend `json:"backends"`
PidFile string `json:"pidfile"`
Mutex *sync.RWMutex `json:"-"`
}
// Defines a single haproxy "backend".
type Backend struct {
Name string `json:"name"`
BackendServers map[string]*BackendServer `json:"servers"`
Options ProxyOptions `json:"options"`
}
// Options which are common between frontends, backends, etc
type ProxyOptions struct {
AbortOnClose bool `json:"abortOnClose"`
AllBackups bool `json:"allBackups"`
CheckCache bool `json:"checkCache"`
ForwardFor bool `json:"forwardFor"`
HttpClose bool `json:"httpClose"`
HttpCheck bool `json:"httpCheck"`
LdapCheck bool `json:"ldapCheck"`
MysqlCheck bool `json:"mysqlCheck"`
PgsqlCheck bool `json:"pgsqlCheck"`
RedisCheck bool `json:"redisCheck"`
SmtpCheck bool `json:"smtpCheck"`
SslHelloCheck bool `json:"sslHelloCheck"`
TcpKeepAlive bool `json:"tcpKeepAlive"`
TcpLog bool `json:"tcpLog"`
TcpSmartAccept bool `json:"tcpSmartAccept"`
TcpSmartConnect bool `json:"tcpSmartConnect"`
Transparent bool `json:"transparent"`
}
// Defines a server which exists in a backend.
type BackendServer struct {
Name string `json:"name"`
Bind string `json:"bind"`
Weight int `json:"weight"`
MaxConn int `json:"maxconn"`
Check bool `json:"check"`
CheckInterval int `json:"checkInterval"`
}