2017-07-10 14:58:12 +00:00
|
|
|
package types
|
|
|
|
|
2017-08-21 08:46:03 +00:00
|
|
|
import "strings"
|
|
|
|
|
2017-07-10 14:58:12 +00:00
|
|
|
const (
|
2017-08-21 08:46:03 +00:00
|
|
|
// LabelPrefix Traefik label
|
|
|
|
LabelPrefix = "traefik."
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelDomain Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelDomain = LabelPrefix + "domain"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelEnable Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelEnable = LabelPrefix + "enable"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelPort Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelPort = LabelPrefix + "port"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelPortIndex Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelPortIndex = LabelPrefix + "portIndex"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelProtocol Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelProtocol = LabelPrefix + "protocol"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelTags Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelTags = LabelPrefix + "tags"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelWeight Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelWeight = LabelPrefix + "weight"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelFrontendAuthBasic Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelFrontendAuthBasic = LabelPrefix + "frontend.auth.basic"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelFrontendEntryPoints Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelFrontendEntryPoints = LabelPrefix + "frontend.entryPoints"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelFrontendPassHostHeader Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelFrontendPassHostHeader = LabelPrefix + "frontend.passHostHeader"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelFrontendPriority Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelFrontendPriority = LabelPrefix + "frontend.priority"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelFrontendRule Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelFrontendRule = LabelPrefix + "frontend.rule"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelFrontendRuleType Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelFrontendRuleType = LabelPrefix + "frontend.rule.type"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelTraefikFrontendValue Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelTraefikFrontendValue = LabelPrefix + "frontend.value"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelTraefikFrontendWhitelistSourceRange Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelTraefikFrontendWhitelistSourceRange = LabelPrefix + "frontend.whitelistSourceRange"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelBackend Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelBackend = LabelPrefix + "backend"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelBackendID Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelBackendID = LabelPrefix + "backend.id"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelTraefikBackendCircuitbreaker Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelTraefikBackendCircuitbreaker = LabelPrefix + "backend.circuitbreaker"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelBackendCircuitbreakerExpression Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelBackendCircuitbreakerExpression = LabelPrefix + "backend.circuitbreaker.expression"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelBackendHealthcheckPath Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelBackendHealthcheckPath = LabelPrefix + "backend.healthcheck.path"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelBackendHealthcheckInterval Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelBackendHealthcheckInterval = LabelPrefix + "backend.healthcheck.interval"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelBackendLoadbalancerMethod Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelBackendLoadbalancerMethod = LabelPrefix + "backend.loadbalancer.method"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelBackendLoadbalancerSticky Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelBackendLoadbalancerSticky = LabelPrefix + "backend.loadbalancer.sticky"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelBackendMaxconnAmount Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelBackendMaxconnAmount = LabelPrefix + "backend.maxconn.amount"
|
2017-07-10 14:58:12 +00:00
|
|
|
// LabelBackendMaxconnExtractorfunc Traefik label
|
2017-08-21 08:46:03 +00:00
|
|
|
LabelBackendMaxconnExtractorfunc = LabelPrefix + "backend.maxconn.extractorfunc"
|
2017-07-10 14:58:12 +00:00
|
|
|
)
|
2017-08-21 08:46:03 +00:00
|
|
|
|
|
|
|
//ServiceLabel converts a key value of Label*, given a serviceName, into a pattern <LabelPrefix>.<serviceName>.<property>
|
|
|
|
// i.e. For LabelFrontendRule and serviceName=app it will return "traefik.app.frontend.rule"
|
|
|
|
func ServiceLabel(key, serviceName string) string {
|
|
|
|
if len(serviceName) > 0 {
|
|
|
|
property := strings.TrimPrefix(key, LabelPrefix)
|
|
|
|
return LabelPrefix + serviceName + "." + property
|
|
|
|
}
|
|
|
|
return key
|
|
|
|
}
|