traefik/configuration.go

43 lines
713 B
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 {
Port string
GraceTimeOut int64
Docker *DockerProvider
File *FileProvider
Web *WebProvider
Marathon *MarathonProvider
}
func NewGlobalConfiguration() *GlobalConfiguration {
globalConfiguration := new(GlobalConfiguration)
// default values
globalConfiguration.Port = ":8080"
globalConfiguration.GraceTimeOut = 10
return globalConfiguration
}
2015-09-07 08:38:58 +00:00
type Backend struct {
Servers map[string]Server
}
type Server struct {
Url string
2015-09-10 14:14:08 +00:00
Weight int
2015-09-07 08:38:58 +00:00
}
type Rule struct {
Category string
Value string
}
type Route struct {
2015-09-09 15:41:33 +00:00
Backend string
2015-09-07 08:38:58 +00:00
Rules map[string]Rule
}
2015-09-07 22:15:14 +00:00
type Configuration struct {
2015-09-07 08:38:58 +00:00
Backends map[string]Backend
Routes map[string]Route
}