traefik/configuration.go

52 lines
1 KiB
Go
Raw Normal View History

2015-09-07 08:38:58 +00:00
package main
2015-09-10 13:13:35 +00:00
type GlobalConfiguration struct {
2015-09-11 14:37:13 +00:00
Port string
GraceTimeOut int64
AccessLogsFile string
TraefikLogsFile string
TraefikLogsStdout bool
2015-09-11 14:48:52 +00:00
CertFile, KeyFile string
2015-09-11 14:37:13 +00:00
LogLevel string
Docker *DockerProvider
File *FileProvider
Web *WebProvider
Marathon *MarathonProvider
2015-09-21 16:05:56 +00:00
Consul *ConsulProvider
2015-09-10 13:13:35 +00:00
}
func NewGlobalConfiguration() *GlobalConfiguration {
globalConfiguration := new(GlobalConfiguration)
// default values
2015-09-14 12:38:21 +00:00
globalConfiguration.Port = ":80"
2015-09-10 13:13:35 +00:00
globalConfiguration.GraceTimeOut = 10
2015-09-11 14:40:54 +00:00
globalConfiguration.LogLevel = "ERROR"
globalConfiguration.TraefikLogsStdout = true
2015-09-10 13:13:35 +00:00
return globalConfiguration
}
2015-09-07 08:38:58 +00:00
type Backend struct {
Servers map[string]Server
}
type Server struct {
2015-09-24 20:17:40 +00:00
URL string
2015-09-10 14:14:08 +00:00
Weight int
2015-09-07 08:38:58 +00:00
}
type Route struct {
Rule string
Value string
2015-09-07 08:38:58 +00:00
}
type Frontend struct {
2015-09-09 15:41:33 +00:00
Backend string
Routes map[string]Route
2015-09-07 08:38:58 +00:00
}
2015-09-07 22:15:14 +00:00
type Configuration struct {
Backends map[string]Backend
Frontends map[string]Frontend
2015-09-12 13:10:03 +00:00
}