// Code generated by go-bindata. // sources: // templates/consul_catalog.tmpl // templates/docker.tmpl // templates/ecs.tmpl // templates/eureka.tmpl // templates/kubernetes.tmpl // templates/kv.tmpl // templates/marathon.tmpl // templates/mesos.tmpl // templates/notFound.tmpl // templates/rancher.tmpl // DO NOT EDIT! package gentemplates import ( "fmt" "io/ioutil" "os" "path/filepath" "strings" "time" ) type asset struct { bytes []byte info os.FileInfo } type bindataFileInfo struct { name string size int64 mode os.FileMode modTime time.Time } func (fi bindataFileInfo) Name() string { return fi.name } func (fi bindataFileInfo) Size() int64 { return fi.size } func (fi bindataFileInfo) Mode() os.FileMode { return fi.mode } func (fi bindataFileInfo) ModTime() time.Time { return fi.modTime } func (fi bindataFileInfo) IsDir() bool { return false } func (fi bindataFileInfo) Sys() interface{} { return nil } var _templatesConsul_catalogTmpl = []byte(`[backends] {{range $service := .Services}} {{ $backendName := getServiceBackendName $service }} {{ $circuitBreaker := getCircuitBreaker $service.Attributes }} {{if $circuitBreaker }} [backends."backend-{{ $backendName }}".circuitBreaker] expression = "{{ $circuitBreaker.Expression }}" {{end}} {{ $loadBalancer := getLoadBalancer $service.Attributes }} {{if $loadBalancer }} [backends."backend-{{ $backendName }}".loadBalancer] method = "{{ $loadBalancer.Method }}" sticky = {{ $loadBalancer.Sticky }} {{if $loadBalancer.Stickiness }} [backends."backend-{{ $backendName }}".loadBalancer.stickiness] cookieName = "{{ $loadBalancer.Stickiness.CookieName }}" {{end}} {{end}} {{ $maxConn := getMaxConn $service.Attributes }} {{if $maxConn }} [backends."backend-{{ $backendName }}".maxConn] extractorFunc = "{{ $maxConn.ExtractorFunc }}" amount = {{ $maxConn.Amount }} {{end}} {{ $healthCheck := getHealthCheck $service.Attributes }} {{if $healthCheck }} [backends.backend-{{ $backendName }}.healthCheck] path = "{{ $healthCheck.Path }}" port = {{ $healthCheck.Port }} interval = "{{ $healthCheck.Interval }}" {{end}} {{end}} {{range $index, $node := .Nodes}} [backends."backend-{{ getNodeBackendName $node }}".servers."{{ getServerName $node $index }}"] url = "{{ getProtocol $node.Service.Tags }}://{{ getBackendAddress $node }}:{{ $node.Service.Port }}" weight = {{ getWeight $node.Service.Tags }} {{end}} [frontends] {{range $service := .Services}} [frontends."frontend-{{ $service.ServiceName }}"] backend = "backend-{{ getServiceBackendName $service }}" priority = {{ getPriority $service.Attributes }} passHostHeader = {{ getPassHostHeader $service.Attributes }} passTLSCert = {{ getPassTLSCert $service.Attributes }} entryPoints = [{{range getFrontEndEntryPoints $service.Attributes }} "{{.}}", {{end}}] {{ $whitelistSourceRange := getWhitelistSourceRange $service.Attributes }} {{if $whitelistSourceRange }} whitelistSourceRange = [{{range $whitelistSourceRange }} "{{.}}", {{end}}] {{end}} basicAuth = [{{range getBasicAuth $service.Attributes }} "{{.}}", {{end}}] {{ $redirect := getRedirect $service.Attributes }} {{if $redirect }} [frontends."frontend-{{ $service.ServiceName }}".redirect] entryPoint = "{{ $redirect.EntryPoint }}" regex = "{{ $redirect.Regex }}" replacement = "{{ $redirect.Replacement }}" {{end}} {{if hasErrorPages $service.Attributes }} [frontends."frontend-{{ $service.ServiceName }}".errors] {{range $pageName, $page := getErrorPages $service.Attributes }} [frontends."frontend-{{ $service.ServiceName }}".errors.{{ $pageName }}] status = [{{range $page.Status }} "{{.}}", {{end}}] backend = "{{ $page.Backend }}" query = "{{ $page.Query }}" {{end}} {{end}} {{if hasRateLimit $service.Attributes }} {{ $rateLimit := getRateLimit $service.Attributes }} [frontends."frontend-{{ $service.ServiceName }}".rateLimit] extractorFunc = "{{ $rateLimit.ExtractorFunc }}" [frontends."frontend-{{ $service.ServiceName }}".rateLimit.rateSet] {{range $limitName, $limit := $rateLimit.RateSet }} [frontends."frontend-{{ $service.ServiceName }}".rateLimit.rateSet.{{ $limitName }}] period = "{{ $limit.Period }}" average = {{ $limit.Average }} burst = {{ $limit.Burst }} {{end}} {{end}} {{ $headers := getHeaders $service.Attributes }} {{if $headers }} [frontends."frontend-{{ $service.ServiceName }}".headers] SSLRedirect = {{ $headers.SSLRedirect }} SSLTemporaryRedirect = {{ $headers.SSLTemporaryRedirect }} SSLHost = "{{ $headers.SSLHost }}" STSSeconds = {{ $headers.STSSeconds }} STSIncludeSubdomains = {{ $headers.STSIncludeSubdomains }} STSPreload = {{ $headers.STSPreload }} ForceSTSHeader = {{ $headers.ForceSTSHeader }} FrameDeny = {{ $headers.FrameDeny }} CustomFrameOptionsValue = "{{ $headers.CustomFrameOptionsValue }}" ContentTypeNosniff = {{ $headers.ContentTypeNosniff }} BrowserXSSFilter = {{ $headers.BrowserXSSFilter }} ContentSecurityPolicy = "{{ $headers.ContentSecurityPolicy }}" PublicKey = "{{ $headers.PublicKey }}" ReferrerPolicy = "{{ $headers.ReferrerPolicy }}" IsDevelopment = {{ $headers.IsDevelopment }} {{if $headers.AllowedHosts }} AllowedHosts = [{{range $headers.AllowedHosts }} "{{.}}", {{end}}] {{end}} {{if $headers.HostsProxyHeaders }} HostsProxyHeaders = [{{range $headers.HostsProxyHeaders }} "{{.}}", {{end}}] {{end}} {{if $headers.CustomRequestHeaders }} [frontends."frontend-{{ $service.ServiceName }}".headers.customRequestHeaders] {{range $k, $v := $headers.CustomRequestHeaders }} {{$k}} = "{{$v}}" {{end}} {{end}} {{if $headers.CustomResponseHeaders }} [frontends."frontend-{{ $service.ServiceName }}".headers.customResponseHeaders] {{range $k, $v := $headers.CustomResponseHeaders }} {{$k}} = "{{$v}}" {{end}} {{end}} {{if $headers.SSLProxyHeaders }} [frontends."frontend-{{ $service.ServiceName }}".headers.SSLProxyHeaders] {{range $k, $v := $headers.SSLProxyHeaders}} {{$k}} = "{{$v}}" {{end}} {{end}} {{end}} [frontends."frontend-{{ $service.ServiceName }}".routes."route-host-{{ $service.ServiceName }}"] rule = "{{ getFrontendRule $service }}" {{end}} `) func templatesConsul_catalogTmplBytes() ([]byte, error) { return _templatesConsul_catalogTmpl, nil } func templatesConsul_catalogTmpl() (*asset, error) { bytes, err := templatesConsul_catalogTmplBytes() if err != nil { return nil, err } info := bindataFileInfo{name: "templates/consul_catalog.tmpl", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} a := &asset{bytes: bytes, info: info} return a, nil } var _templatesDockerTmpl = []byte(`{{$backendServers := .Servers}} [backends] {{range $backendName, $backend := .Backends}} {{ $circuitBreaker := getCircuitBreaker $backend }} {{if $circuitBreaker }} [backends."backend-{{ $backendName }}".circuitBreaker] expression = "{{ $circuitBreaker.Expression }}" {{end}} {{ $loadBalancer := getLoadBalancer $backend }} {{if $loadBalancer }} [backends."backend-{{ $backendName }}".loadBalancer] method = "{{ $loadBalancer.Method }}" sticky = {{ $loadBalancer.Sticky }} {{if $loadBalancer.Stickiness }} [backends."backend-{{ $backendName }}".loadBalancer.stickiness] cookieName = "{{ $loadBalancer.Stickiness.CookieName }}" {{end}} {{end}} {{ $maxConn := getMaxConn $backend }} {{if $maxConn }} [backends."backend-{{ $backendName }}".maxConn] extractorFunc = "{{ $maxConn.ExtractorFunc }}" amount = {{ $maxConn.Amount }} {{end}} {{ $healthCheck := getHealthCheck $backend }} {{if $healthCheck }} [backends.backend-{{ $backendName }}.healthCheck] path = "{{ $healthCheck.Path }}" port = {{ $healthCheck.Port }} interval = "{{ $healthCheck.Interval }}" {{end}} {{ $servers := index $backendServers $backendName }} {{range $serverName, $server := $servers }} {{if hasServices $server }} {{ $services := getServiceNames $server }} {{range $serviceIndex, $serviceName := $services }} [backends.backend-{{ getServiceBackendName $server $serviceName }}.servers.service-{{ $serverName }}] url = "{{ getServiceProtocol $server $serviceName }}://{{ getIPAddress $server }}:{{ getServicePort $server $serviceName }}" weight = {{ getServiceWeight $server $serviceName }} {{end}} {{else}} [backends.backend-{{ $backendName }}.servers.server-{{ $server.Name | replace "/" "" | replace "." "-" }}] url = "{{ getProtocol $server }}://{{ getIPAddress $server }}:{{ getPort $server }}" weight = {{ getWeight $server }} {{end}} {{end}} {{end}} [frontends] {{range $frontendName, $containers := .Frontends }} {{$container := index $containers 0}} {{if hasServices $container }} {{ $services := getServiceNames $container }} {{range $serviceIndex, $serviceName := $services }} {{ $ServiceFrontendName := getServiceBackendName $container $serviceName }} [frontends."frontend-{{ $ServiceFrontendName }}"] backend = "backend-{{ $ServiceFrontendName }}" priority = {{ getServicePriority $container $serviceName }} passHostHeader = {{ getServicePassHostHeader $container $serviceName }} passTLSCert = {{ getServicePassTLSCert $container $serviceName }} entryPoints = [{{range getServiceEntryPoints $container $serviceName }} "{{.}}", {{end}}] {{ $whitelistSourceRange := getServiceWhitelistSourceRange $container $serviceName }} {{if $whitelistSourceRange }} whitelistSourceRange = [{{range $whitelistSourceRange }} "{{.}}", {{end}}] {{end}} basicAuth = [{{range getServiceBasicAuth $container $serviceName }} "{{.}}", {{end}}] {{ $redirect := getServiceRedirect $container $serviceName }} {{if $redirect }} [frontends."frontend-{{ $ServiceFrontendName }}".redirect] entryPoint = "{{ $redirect.EntryPoint }}" regex = "{{ $redirect.Regex }}" replacement = "{{ $redirect.Replacement }}" {{end}} {{ $errorPages := getServiceErrorPages $container $serviceName }} {{if $errorPages }} [frontends."frontend-{{ $ServiceFrontendName }}".errors] {{ range $pageName, $page := $errorPages }} [frontends."frontend-{{ $ServiceFrontendName }}".errors.{{ $pageName }}] status = [{{range $page.Status }} "{{.}}", {{end}}] backend = "{{ $page.Backend }}" query = "{{ $page.Query }}" {{end}} {{end}} {{ $rateLimit := getServiceRateLimit $container $serviceName }} {{if $rateLimit }} [frontends."frontend-{{ $ServiceFrontendName }}".rateLimit] extractorFunc = "{{ $rateLimit.ExtractorFunc }}" [frontends."frontend-{{ $ServiceFrontendName }}".rateLimit.rateSet] {{range $limitName, $limit := $rateLimit.RateSet }} [frontends."frontend-{{ $ServiceFrontendName }}".rateLimit.rateSet.{{ $limitName }}] period = "{{ $limit.Period }}" average = {{ $limit.Average }} burst = {{ $limit.Burst }} {{end}} {{end}} {{ $headers := getServiceHeaders $container $serviceName }} {{if $headers }} [frontends."frontend-{{ $ServiceFrontendName }}".headers] SSLRedirect = {{ $headers.SSLRedirect }} SSLTemporaryRedirect = {{ $headers.SSLTemporaryRedirect }} SSLHost = "{{ $headers.SSLHost }}" STSSeconds = {{ $headers.STSSeconds }} STSIncludeSubdomains = {{ $headers.STSIncludeSubdomains }} STSPreload = {{ $headers.STSPreload }} ForceSTSHeader = {{ $headers.ForceSTSHeader }} FrameDeny = {{ $headers.FrameDeny }} CustomFrameOptionsValue = "{{ $headers.CustomFrameOptionsValue }}" ContentTypeNosniff = {{ $headers.ContentTypeNosniff }} BrowserXSSFilter = {{ $headers.BrowserXSSFilter }} ContentSecurityPolicy = "{{ $headers.ContentSecurityPolicy }}" PublicKey = "{{ $headers.PublicKey }}" ReferrerPolicy = "{{ $headers.ReferrerPolicy }}" IsDevelopment = {{ $headers.IsDevelopment }} {{if $headers.AllowedHosts }} AllowedHosts = [{{range $headers.AllowedHosts }} "{{.}}", {{end}}] {{end}} {{if $headers.HostsProxyHeaders }} HostsProxyHeaders = [{{range $headers.HostsProxyHeaders }} "{{.}}", {{end}}] {{end}} {{if $headers.CustomRequestHeaders }} [frontends."frontend-{{ $ServiceFrontendName }}".headers.customRequestHeaders] {{range $k, $v := $headers.CustomRequestHeaders }} {{$k}} = "{{$v}}" {{end}} {{end}} {{if $headers.CustomResponseHeaders }} [frontends."frontend-{{ $ServiceFrontendName }}".headers.customResponseHeaders] {{range $k, $v := $headers.CustomResponseHeaders }} {{$k}} = "{{$v}}" {{end}} {{end}} {{if $headers.SSLProxyHeaders }} [frontends."frontend-{{ $ServiceFrontendName }}".headers.SSLProxyHeaders] {{range $k, $v := $headers.SSLProxyHeaders }} {{$k}} = "{{$v}}" {{end}} {{end}} {{end}} [frontends."frontend-{{ $ServiceFrontendName }}".routes."service-{{ $serviceName | replace "/" "" | replace "." "-" }}"] rule = "{{ getServiceFrontendRule $container $serviceName }}" {{end}} ## end range services {{else}} [frontends."frontend-{{ $frontendName }}"] backend = "backend-{{ getBackendName $container }}" priority = {{ getPriority $container }} passHostHeader = {{ getPassHostHeader $container }} passTLSCert = {{ getPassTLSCert $container }} entryPoints = [{{range getEntryPoints $container }} "{{.}}", {{end}}] {{ $whitelistSourceRange := getWhitelistSourceRange $container}} {{if $whitelistSourceRange }} whitelistSourceRange = [{{range $whitelistSourceRange }} "{{.}}", {{end}}] {{end}} basicAuth = [{{range getBasicAuth $container }} "{{.}}", {{end}}] {{ $redirect := getRedirect $container }} {{if $redirect }} [frontends."frontend-{{ $frontendName }}".redirect] entryPoint = "{{ $redirect.EntryPoint }}" regex = "{{ $redirect.Regex }}" replacement = "{{ $redirect.Replacement }}" {{end}} {{ $errorPages := getErrorPages $container }} {{if $errorPages }} [frontends."frontend-{{ $frontendName }}".errors] {{range $pageName, $page := $errorPages }} [frontends."frontend-{{ $frontendName }}".errors.{{ $pageName }}] status = [{{range $page.Status }} "{{.}}", {{end}}] backend = "{{ $page.Backend }}" query = "{{ $page.Query }}" {{end}} {{end}} {{ $rateLimit := getRateLimit $container }} {{if $rateLimit }} [frontends."frontend-{{ $frontendName }}".rateLimit] extractorFunc = "{{ $rateLimit.ExtractorFunc }}" [frontends."frontend-{{ $frontendName }}".rateLimit.rateSet] {{ range $limitName, $limit := $rateLimit.RateSet }} [frontends."frontend-{{ $frontendName }}".rateLimit.rateSet.{{ $limitName }}] period = "{{ $limit.Period }}" average = {{ $limit.Average }} burst = {{ $limit.Burst }} {{end}} {{end}} {{ $headers := getHeaders $container }} {{if $headers }} [frontends."frontend-{{ $frontendName }}".headers] SSLRedirect = {{ $headers.SSLRedirect }} SSLTemporaryRedirect = {{ $headers.SSLTemporaryRedirect }} SSLHost = "{{ $headers.SSLHost }}" STSSeconds = {{ $headers.STSSeconds }} STSIncludeSubdomains = {{ $headers.STSIncludeSubdomains }} STSPreload = {{ $headers.STSPreload }} ForceSTSHeader = {{ $headers.ForceSTSHeader }} FrameDeny = {{ $headers.FrameDeny }} CustomFrameOptionsValue = "{{ $headers.CustomFrameOptionsValue }}" ContentTypeNosniff = {{ $headers.ContentTypeNosniff }} BrowserXSSFilter = {{ $headers.BrowserXSSFilter }} ContentSecurityPolicy = "{{ $headers.ContentSecurityPolicy }}" PublicKey = "{{ $headers.PublicKey }}" ReferrerPolicy = "{{ $headers.ReferrerPolicy }}" IsDevelopment = {{ $headers.IsDevelopment }} {{if $headers.AllowedHosts }} AllowedHosts = [{{range $headers.AllowedHosts }} "{{.}}", {{end}}] {{end}} {{if $headers.HostsProxyHeaders }} HostsProxyHeaders = [{{range $headers.HostsProxyHeaders }} "{{.}}", {{end}}] {{end}} {{if $headers.CustomRequestHeaders }} [frontends."frontend-{{ $frontendName }}".headers.customRequestHeaders] {{range $k, $v := $headers.CustomRequestHeaders }} {{$k}} = "{{$v}}" {{end}} {{end}} {{if $headers.CustomResponseHeaders }} [frontends."frontend-{{ $frontendName }}".headers.customResponseHeaders] {{range $k, $v := $headers.CustomResponseHeaders }} {{$k}} = "{{$v}}" {{end}} {{end}} {{if $headers.SSLProxyHeaders }} [frontends."frontend-{{ $frontendName }}".headers.SSLProxyHeaders] {{range $k, $v := $headers.SSLProxyHeaders }} {{$k}} = "{{$v}}" {{end}} {{end}} {{end}} [frontends."frontend-{{ $frontendName }}".routes."route-frontend-{{ $frontendName }}"] rule = "{{ getFrontendRule $container }}" {{end}} {{end}} `) func templatesDockerTmplBytes() ([]byte, error) { return _templatesDockerTmpl, nil } func templatesDockerTmpl() (*asset, error) { bytes, err := templatesDockerTmplBytes() if err != nil { return nil, err } info := bindataFileInfo{name: "templates/docker.tmpl", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} a := &asset{bytes: bytes, info: info} return a, nil } var _templatesEcsTmpl = []byte(`[backends] {{range $serviceName, $instances := .Services}} {{if hasCircuitBreakerLabel $instances}} [backends.backend-{{ $serviceName }}.circuitBreaker] expression = "{{getCircuitBreakerExpression $instances}}" {{end}} {{if hasLoadBalancerLabel $instances}} [backends.backend-{{ $serviceName }}.loadBalancer] method = "{{ getLoadBalancerMethod $instances}}" sticky = {{ getSticky $instances}} {{if hasStickinessLabel $instances}} [backends.backend-{{ $serviceName }}.loadBalancer.stickiness] cookieName = "{{getStickinessCookieName $instances}}" {{end}} {{end}} {{if hasMaxConnLabels $instances}} [backends.backend-{{ $serviceName }}.maxConn] amount = {{getMaxConnAmount $instances}} extractorFunc = "{{getMaxConnExtractorFunc $instances}}" {{end}} {{ if hasHealthCheckLabels $instances }} [backends.backend-{{ $serviceName }}.healthCheck] path = "{{getHealthCheckPath $instances }}" port = {{getHealthCheckPort $instances}} interval = "{{getHealthCheckInterval $instances }}" {{end}} {{range $index, $instance := $instances}} [backends.backend-{{ $instance.Name }}.servers.server-{{ $instance.Name }}{{ $instance.ID }}] url = "{{ getProtocol $instance }}://{{ getHost $instance }}:{{ getPort $instance }}" weight = {{ getWeight $instance}} {{end}} {{end}} [frontends] {{range $serviceName, $instances := .Services}} {{range $instance := filterFrontends $instances}} [frontends.frontend-{{ $serviceName }}] backend = "backend-{{ $serviceName }}" priority = {{ getPriority $instance}} passHostHeader = {{ getPassHostHeader $instance}} passTLSCert = {{ getPassTLSCert $instance}} entryPoints = [{{range getEntryPoints $instance}} "{{.}}", {{end}}] {{if getWhitelistSourceRange $instance}} whitelistSourceRange = [{{range getWhitelistSourceRange $instance}} "{{.}}", {{end}}] {{end}} basicAuth = [{{range getBasicAuth $instance}} "{{.}}", {{end}}] {{if hasRedirect $instance}} [frontends."frontend-{{ $serviceName }}".redirect] entryPoint = "{{getRedirectEntryPoint $instance}}" regex = "{{getRedirectRegex $instance}}" replacement = "{{getRedirectReplacement $instance}}" {{end}} {{ if hasErrorPages $instance }} [frontends."frontend-{{ $serviceName }}".errors] {{ range $pageName, $page := getErrorPages $instance }} [frontends."frontend-{{ $serviceName }}".errors.{{ $pageName }}] status = [{{range $page.Status}} "{{.}}", {{end}}] backend = "{{$page.Backend}}" query = "{{$page.Query}}" {{end}} {{end}} {{ if hasRateLimits $instance }} [frontends."frontend-{{ $serviceName }}".rateLimit] extractorFunc = "{{ getRateLimitsExtractorFunc $instance }}" [frontends."frontend-{{ $serviceName }}".rateLimit.rateSet] {{ range $limitName, $rateLimit := getRateLimits $instance }} [frontends."frontend-{{ $serviceName }}".rateLimit.rateSet.{{ $limitName }}] period = "{{ $rateLimit.Period }}" average = {{ $rateLimit.Average }} burst = {{ $rateLimit.Burst }} {{end}} {{end}} {{if hasHeaders $instance }} [frontends."frontend-{{ $serviceName }}".headers] {{if hasSSLRedirectHeaders $instance}} SSLRedirect = {{getSSLRedirectHeaders $instance}} {{end}} {{if hasSSLTemporaryRedirectHeaders $instance}} SSLTemporaryRedirect = {{getSSLTemporaryRedirectHeaders $instance}} {{end}} {{if hasSSLHostHeaders $instance}} SSLHost = "{{getSSLHostHeaders $instance}}" {{end}} {{if hasSTSSecondsHeaders $instance}} STSSeconds = {{getSTSSecondsHeaders $instance}} {{end}} {{if hasSTSIncludeSubdomainsHeaders $instance}} STSIncludeSubdomains = {{getSTSIncludeSubdomainsHeaders $instance}} {{end}} {{if hasSTSPreloadHeaders $instance}} STSPreload = {{getSTSPreloadHeaders $instance}} {{end}} {{if hasForceSTSHeaderHeaders $instance}} ForceSTSHeader = {{getForceSTSHeaderHeaders $instance}} {{end}} {{if hasFrameDenyHeaders $instance}} FrameDeny = {{getFrameDenyHeaders $instance}} {{end}} {{if hasCustomFrameOptionsValueHeaders $instance}} CustomFrameOptionsValue = "{{getCustomFrameOptionsValueHeaders $instance}}" {{end}} {{if hasContentTypeNosniffHeaders $instance}} ContentTypeNosniff = {{getContentTypeNosniffHeaders $instance}} {{end}} {{if hasBrowserXSSFilterHeaders $instance}} BrowserXSSFilter = {{getBrowserXSSFilterHeaders $instance}} {{end}} {{if hasContentSecurityPolicyHeaders $instance}} ContentSecurityPolicy = "{{getContentSecurityPolicyHeaders $instance}}" {{end}} {{if hasPublicKeyHeaders $instance}} PublicKey = "{{getPublicKeyHeaders $instance}}" {{end}} {{if hasReferrerPolicyHeaders $instance}} ReferrerPolicy = "{{getReferrerPolicyHeaders $instance}}" {{end}} {{if hasIsDevelopmentHeaders $instance}} IsDevelopment = {{getIsDevelopmentHeaders $instance}} {{end}} {{if hasRequestHeaders $instance}} [frontends."frontend-{{ $serviceName }}".headers.customRequestHeaders] {{range $k, $v := getRequestHeaders $instance}} {{$k}} = "{{$v}}" {{end}} {{end}} {{if hasResponseHeaders $instance}} [frontends."frontend-{{ $serviceName }}".headers.customResponseHeaders] {{range $k, $v := getResponseHeaders $instance}} {{$k}} = "{{$v}}" {{end}} {{end}} {{if hasAllowedHostsHeaders $instance}} [frontends."frontend-{{ $serviceName }}".headers.AllowedHosts] {{range getAllowedHostsHeaders $instance}} "{{.}}" {{end}} {{end}} {{if hasHostsProxyHeaders $instance}} [frontends."frontend-{{ $serviceName }}".headers.HostsProxyHeaders] {{range getHostsProxyHeaders $instance}} "{{.}}" {{end}} {{end}} {{if hasSSLProxyHeaders $instance}} [frontends."frontend-{{ $serviceName }}".headers.SSLProxyHeaders] {{range $k, $v := getSSLProxyHeaders $instance}} {{$k}} = "{{$v}}" {{end}} {{end}} {{end}} [frontends.frontend-{{ $serviceName }}.routes.route-frontend-{{ $serviceName }}] rule = "{{getFrontendRule $instance}}" {{end}} {{end}}`) func templatesEcsTmplBytes() ([]byte, error) { return _templatesEcsTmpl, nil } func templatesEcsTmpl() (*asset, error) { bytes, err := templatesEcsTmplBytes() if err != nil { return nil, err } info := bindataFileInfo{name: "templates/ecs.tmpl", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} a := &asset{bytes: bytes, info: info} return a, nil } var _templatesEurekaTmpl = []byte(`[backends]{{range .Applications}} {{ $app := .}} {{range .Instances}} [backends.backend{{$app.Name}}.servers.server-{{ getInstanceID . }}] url = "{{ getProtocol . }}://{{ .IpAddr }}:{{ getPort . }}" weight = {{ getWeight . }} {{end}}{{end}} [frontends]{{range .Applications}} [frontends.frontend{{.Name}}] backend = "backend{{.Name}}" entryPoints = ["http"] [frontends.frontend{{.Name }}.routes.route-host{{.Name}}] rule = "Host:{{ .Name | tolower }}" {{end}} `) func templatesEurekaTmplBytes() ([]byte, error) { return _templatesEurekaTmpl, nil } func templatesEurekaTmpl() (*asset, error) { bytes, err := templatesEurekaTmplBytes() if err != nil { return nil, err } info := bindataFileInfo{name: "templates/eureka.tmpl", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} a := &asset{bytes: bytes, info: info} return a, nil } var _templatesKubernetesTmpl = []byte(`[backends]{{range $backendName, $backend := .Backends}} [backends."{{$backendName}}"] {{if $backend.CircuitBreaker}} [backends."{{$backendName}}".circuitbreaker] expression = "{{$backend.CircuitBreaker.Expression}}" {{end}} [backends."{{$backendName}}".loadbalancer] method = "{{$backend.LoadBalancer.Method}}" {{if $backend.LoadBalancer.Sticky}} sticky = true {{end}} {{if $backend.LoadBalancer.Stickiness}} [backends."{{$backendName}}".loadbalancer.stickiness] cookieName = "{{$backend.LoadBalancer.Stickiness.CookieName}}" {{end}} {{range $serverName, $server := $backend.Servers}} [backends."{{$backendName}}".servers."{{$serverName}}"] url = "{{$server.URL}}" weight = {{$server.Weight}} {{end}} {{end}} [frontends]{{range $frontendName, $frontend := .Frontends}} [frontends."{{$frontendName}}"] backend = "{{$frontend.Backend}}" priority = {{$frontend.Priority}} passHostHeader = {{$frontend.PassHostHeader}} entryPoints = [{{range $frontend.EntryPoints}} "{{.}}", {{end}}] basicAuth = [{{range $frontend.BasicAuth}} "{{.}}", {{end}}] whitelistSourceRange = [{{range $frontend.WhitelistSourceRange}} "{{.}}", {{end}}] {{if $frontend.Redirect}} [frontends."{{$frontendName}}".redirect] entryPoint = "{{$frontend.RedirectEntryPoint}}" regex = "{{$frontend.RedirectRegex}}" replacement = "{{$frontend.RedirectReplacement}}" {{end}} {{if $frontend.Headers }} [frontends."{{$frontendName}}".headers] SSLRedirect = {{$frontend.Headers.SSLRedirect}} SSLTemporaryRedirect = {{$frontend.Headers.SSLTemporaryRedirect}} SSLHost = "{{$frontend.Headers.SSLHost}}" STSSeconds = {{$frontend.Headers.STSSeconds}} STSIncludeSubdomains = {{$frontend.Headers.STSIncludeSubdomains}} STSPreload = {{$frontend.Headers.STSPreload}} ForceSTSHeader = {{$frontend.Headers.ForceSTSHeader}} FrameDeny = {{$frontend.Headers.FrameDeny}} CustomFrameOptionsValue = "{{$frontend.Headers.CustomFrameOptionsValue}}" ContentTypeNosniff = {{$frontend.Headers.ContentTypeNosniff}} BrowserXSSFilter = {{$frontend.Headers.BrowserXSSFilter}} ContentSecurityPolicy = "{{$frontend.Headers.ContentSecurityPolicy}}" PublicKey = "{{$frontend.Headers.PublicKey}}" ReferrerPolicy = "{{$frontend.Headers.ReferrerPolicy}}" IsDevelopment = {{$frontend.Headers.IsDevelopment}} {{if $frontend.Headers.AllowedHosts}} AllowedHosts = [{{range $frontend.Headers.AllowedHosts}} "{{.}}", {{end}}] {{end}} {{if $frontend.Headers.HostsProxyHeaders}} HostsProxyHeaders = [{{range $frontend.Headers.HostsProxyHeaders}} "{{.}}", {{end}}] {{end}} {{if $frontend.Headers.CustomRequestHeaders}} [frontends."{{$frontendName}}".headers.customrequestheaders] {{range $k, $v := $frontend.Headers.CustomRequestHeaders}} {{$k}} = "{{$v}}" {{end}} {{end}} {{if $frontend.Headers.CustomResponseHeaders}} [frontends."{{$frontendName}}".headers.customresponseheaders] {{range $k, $v := $frontend.Headers.CustomResponseHeaders}} {{$k}} = "{{$v}}" {{end}} {{end}} {{if $frontend.Headers.SSLProxyHeaders}} [frontends."{{$frontendName}}".headers.SSLProxyHeaders] {{range $k, $v := $frontend.Headers.SSLProxyHeaders}} {{$k}} = "{{$v}}" {{end}} {{end}} {{end}} {{range $routeName, $route := $frontend.Routes}} [frontends."{{$frontendName}}".routes."{{$routeName}}"] rule = "{{$route.Rule}}" {{end}} {{end}} {{range $tlsConfiguration := .TLSConfiguration}} [[tlsConfiguration]] entryPoints = [{{range $tlsConfiguration.EntryPoints}} "{{.}}", {{end}}] [tlsConfiguration.certificate] certFile = """{{$tlsConfiguration.Certificate.CertFile}}""" keyFile = """{{$tlsConfiguration.Certificate.KeyFile}}""" {{end}} `) func templatesKubernetesTmplBytes() ([]byte, error) { return _templatesKubernetesTmpl, nil } func templatesKubernetesTmpl() (*asset, error) { bytes, err := templatesKubernetesTmplBytes() if err != nil { return nil, err } info := bindataFileInfo{name: "templates/kubernetes.tmpl", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} a := &asset{bytes: bytes, info: info} return a, nil } var _templatesKvTmpl = []byte(`[backends] {{range $backend := List .Prefix "/backends/" }} {{ $backendName := Last $backend }} {{ $circuitBreaker := getCircuitBreaker $backend }} {{if $circuitBreaker }} [backends."{{ $backendName }}".circuitBreaker] expression = "{{ $circuitBreaker.Expression }}" {{end}} {{ $loadBalancer := getLoadBalancer $backend }} {{if $loadBalancer }} [backends."{{ $backendName }}".loadBalancer] method = "{{ $loadBalancer.Method }}" sticky = {{ $loadBalancer.Sticky }} {{if $loadBalancer.Stickiness }} [backends."{{ $backendName }}".loadBalancer.stickiness] cookieName = "{{ $loadBalancer.Stickiness.CookieName }}" {{end}} {{end}} {{ $maxConn := getMaxConn $backend }} {{if $maxConn }} [backends."{{ $backendName }}".maxConn] extractorFunc = "{{ $maxConn.ExtractorFunc }}" amount = {{ $maxConn.Amount }} {{end}} {{ $healthCheck := getHealthCheck $backend }} {{if $healthCheck }} [backends.{{ $backendName }}.healthCheck] path = "{{ $healthCheck.Path }}" port = {{ $healthCheck.Port }} interval = "{{ $healthCheck.Interval }}" {{end}} {{range $serverName, $server := getServers $backend}} [backends."{{ $backendName }}".servers."{{ $serverName }}"] url = "{{ $server.URL }}" weight = {{ $server.Weight }} {{end}} {{end}} [frontends] {{range $frontend := List .Prefix "/frontends/" }} {{ $frontendName := Last $frontend }} [frontends."{{ $frontendName }}"] backend = "{{ getBackendName $frontend }}" priority = {{ getPriority $frontend }} passHostHeader = {{ getPassHostHeader $frontend }} passTLSCert = {{ getPassTLSCert $frontend }} entryPoints = [{{range getEntryPoints $frontend }} "{{.}}", {{end}}] {{ $whitelistSourceRange := getWhitelistSourceRange $frontend }} {{if $whitelistSourceRange }} whitelistSourceRange = [{{range $whitelistSourceRange }} "{{.}}", {{end}}] {{end}} basicAuth = [{{range getBasicAuth $frontend }} "{{.}}", {{end}}] {{ $redirect := getRedirect $frontend }} {{if $redirect }} [frontends."{{ $frontendName }}".redirect] entryPoint = "{{ $redirect.EntryPoint }}" regex = "{{ $redirect.Regex }}" replacement = "{{ $redirect.Replacement }}" {{end}} {{ $errorPages := getErrorPages $frontend }} {{if $errorPages }} [frontends."{{ $frontendName }}".errors] {{range $pageName, $page := $errorPages }} [frontends."{{$frontendName}}".errors.{{ $pageName }}] status = [{{range $page.Status }} "{{.}}", {{end}}] backend = "{{$page.Backend}}" query = "{{$page.Query}}" {{end}} {{end}} {{ $rateLimit := getRateLimit $frontend }} {{if $rateLimit }} [frontends."{{ $frontendName }}".rateLimit] extractorFunc = "{{ $rateLimit.ExtractorFunc }}" [frontends."{{ $frontendName }}".rateLimit.rateSet] {{range $limitName, $rateLimit := $rateLimit.RateSet }} [frontends."{{ $frontendName }}".rateLimit.rateSet.{{ $limitName }}] period = "{{ $rateLimit.Period }}" average = {{ $rateLimit.Average }} burst = {{ $rateLimit.Burst }} {{end}} {{end}} {{ $headers := getHeaders $frontend }} {{if $headers }} [frontends."{{ $frontendName }}".headers] SSLRedirect = {{ $headers.SSLRedirect }} SSLTemporaryRedirect = {{ $headers.SSLTemporaryRedirect }} SSLHost = "{{ $headers.SSLHost }}" STSSeconds = {{ $headers.STSSeconds }} STSIncludeSubdomains = {{ $headers.STSIncludeSubdomains }} STSPreload = {{ $headers.STSPreload }} ForceSTSHeader = {{ $headers.ForceSTSHeader }} FrameDeny = {{ $headers.FrameDeny }} CustomFrameOptionsValue = "{{ $headers.CustomFrameOptionsValue }}" ContentTypeNosniff = {{ $headers.ContentTypeNosniff }} BrowserXSSFilter = {{ $headers.BrowserXSSFilter }} ContentSecurityPolicy = "{{ $headers.ContentSecurityPolicy }}" PublicKey = "{{ $headers.PublicKey }}" ReferrerPolicy = "{{ $headers.ReferrerPolicy }}" IsDevelopment = {{ $headers.IsDevelopment }} {{if $headers.AllowedHosts }} AllowedHosts = [{{range $headers.AllowedHosts }} "{{.}}", {{end}}] {{end}} {{if $headers.HostsProxyHeaders }} HostsProxyHeaders = [{{range $headers.HostsProxyHeaders }} "{{.}}", {{end}}] {{end}} {{if $headers.CustomRequestHeaders }} [frontends."{{ $frontendName }}".headers.customRequestHeaders] {{range $k, $v := $headers.CustomRequestHeaders }} {{$k}} = "{{$v}}" {{end}} {{end}} {{if $headers.CustomResponseHeaders }} [frontends."{{ $frontendName }}".headers.customResponseHeaders] {{range $k, $v := $headers.CustomResponseHeaders }} {{$k}} = "{{$v}}" {{end}} {{end}} {{if $headers.SSLProxyHeaders }} [frontends."{{ $frontendName }}".headers.SSLProxyHeaders] {{range $k, $v := $headers.SSLProxyHeaders}} {{$k}} = "{{$v}}" {{end}} {{end}} {{end}} {{range $routeName, $route := getRoutes $frontend }} [frontends."{{ $frontendName }}".routes."{{ $routeName }}"] rule = "{{ $route.Rule }}" {{end}} {{end}} {{range $tlsConfiguration := getTLSConfigurations .Prefix }} [[tlsConfiguration]] entryPoints = [{{range $tlsConfiguration.EntryPoints }} "{{.}}", {{end}}] [tlsConfiguration.certificate] certFile = """{{ $tlsConfiguration.Certificate.CertFile }}""" keyFile = """{{ $tlsConfiguration.Certificate.KeyFile }}""" {{end}} `) func templatesKvTmplBytes() ([]byte, error) { return _templatesKvTmpl, nil } func templatesKvTmpl() (*asset, error) { bytes, err := templatesKvTmplBytes() if err != nil { return nil, err } info := bindataFileInfo{name: "templates/kv.tmpl", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} a := &asset{bytes: bytes, info: info} return a, nil } var _templatesMarathonTmpl = []byte(`{{ $apps := .Applications }} [backends] {{range $app := $apps }} {{range $serviceIndex, $serviceName := getServiceNames $app }} {{ $backendName := getBackend $app $serviceName}} [backends."{{ $backendName }}"] {{ $circuitBreaker := getCircuitBreaker $app }} {{if $circuitBreaker }} [backends."{{ $backendName }}".circuitBreaker] expression = "{{ $circuitBreaker.Expression }}" {{end}} {{ $loadBalancer := getLoadBalancer $app }} {{if $loadBalancer }} [backends."{{ $backendName }}".loadBalancer] method = "{{ $loadBalancer.Method }}" sticky = {{ $loadBalancer.Sticky }} {{if $loadBalancer.Stickiness }} [backends."{{ $backendName }}".loadBalancer.stickiness] cookieName = "{{ $loadBalancer.Stickiness.CookieName }}" {{end}} {{end}} {{ $maxConn := getMaxConn $app }} {{if $maxConn }} [backends."{{ $backendName }}".maxConn] extractorFunc = "{{ $maxConn.ExtractorFunc }}" amount = {{ $maxConn.Amount }} {{end}} {{ $healthCheck := getHealthCheck $app }} {{if $healthCheck }} [backends."{{ $backendName }}".healthCheck] path = "{{ $healthCheck.Path }}" port = {{ $healthCheck.Port }} interval = "{{ $healthCheck.Interval }}" {{end}} {{range $serverName, $server := getServers $app $serviceName }} [backends."{{ $backendName }}".servers."{{ $serverName }}"] url = "{{ $server.URL }}" weight = {{ $server.Weight }} {{end}} {{end}} {{end}} [frontends] {{range $app := $apps }} {{range $serviceIndex, $serviceName := getServiceNames $app }} {{ $frontendName := getFrontendName $app $serviceName }} [frontends."{{ $frontendName }}"] backend = "{{ getBackend $app $serviceName }}" priority = {{ getPriority $app $serviceName }} passHostHeader = {{ getPassHostHeader $app $serviceName }} passTLSCert = {{ getPassTLSCert $app $serviceName }} entryPoints = [{{range getEntryPoints $app $serviceName }} "{{.}}", {{end}}] {{ $whitelistSourceRange := getWhitelistSourceRange $app $serviceName }} {{if $whitelistSourceRange }} whitelistSourceRange = [{{range $whitelistSourceRange }} "{{.}}", {{end}}] {{end}} basicAuth = [{{range getBasicAuth $app $serviceName }} "{{.}}", {{end}}] {{ $redirect := getRedirect $app $serviceName }} {{if $redirect }} [frontends."{{ $frontendName }}".redirect] entryPoint = "{{ $redirect.EntryPoint }}" regex = "{{ $redirect.Regex }}" replacement = "{{ $redirect.Replacement }}" {{end}} {{ $errorPages := getErrorPages $app $serviceName }} {{if $errorPages }} [frontends."{{ $frontendName }}".errors] {{range $pageName, $page := $errorPages }} [frontends."{{ $frontendName }}".errors.{{ $pageName }}] status = [{{range $page.Status }} "{{.}}", {{end}}] backend = "{{ $page.Backend }}" query = "{{ $page.Query }}" {{end}} {{end}} {{ $rateLimit := getRateLimit $app $serviceName }} {{if $rateLimit }} [frontends."{{ $frontendName }}".rateLimit] extractorFunc = "{{ $rateLimit.ExtractorFunc }}" [frontends."{{ $frontendName }}".rateLimit.rateSet] {{ range $limitName, $limit := $rateLimit.RateSet }} [frontends."{{ $frontendName }}".rateLimit.rateSet.{{ $limitName }}] period = "{{ $limit.Period }}" average = {{ $limit.Average }} burst = {{ $limit.Burst }} {{end}} {{end}} {{ $headers := getHeaders $app $serviceName }} {{if $headers }} [frontends."{{ $frontendName }}".headers] SSLRedirect = {{ $headers.SSLRedirect }} SSLTemporaryRedirect = {{ $headers.SSLTemporaryRedirect }} SSLHost = "{{ $headers.SSLHost }}" STSSeconds = {{ $headers.STSSeconds }} STSIncludeSubdomains = {{ $headers.STSIncludeSubdomains }} STSPreload = {{ $headers.STSPreload }} ForceSTSHeader = {{ $headers.ForceSTSHeader }} FrameDeny = {{ $headers.FrameDeny }} CustomFrameOptionsValue = "{{ $headers.CustomFrameOptionsValue }}" ContentTypeNosniff = {{ $headers.ContentTypeNosniff }} BrowserXSSFilter = {{ $headers.BrowserXSSFilter }} ContentSecurityPolicy = "{{ $headers.ContentSecurityPolicy }}" PublicKey = "{{ $headers.PublicKey }}" ReferrerPolicy = "{{ $headers.ReferrerPolicy }}" IsDevelopment = {{ $headers.IsDevelopment }} {{if $headers.AllowedHosts }} AllowedHosts = [{{range $headers.AllowedHosts }} "{{.}}", {{end}}] {{end}} {{if $headers.HostsProxyHeaders }} HostsProxyHeaders = [{{range $headers.HostsProxyHeaders }} "{{.}}", {{end}}] {{end}} {{if $headers.CustomRequestHeaders }} [frontends."{{ $frontendName }}".headers.customRequestHeaders] {{range $k, $v := $headers.CustomRequestHeaders }} {{$k}} = "{{$v}}" {{end}} {{end}} {{if $headers.CustomResponseHeaders }} [frontends."{{ $frontendName }}".headers.customResponseHeaders] {{range $k, $v := $headers.CustomResponseHeaders }} {{$k}} = "{{$v}}" {{end}} {{end}} {{if $headers.SSLProxyHeaders }} [frontends."{{ $frontendName }}".headers.SSLProxyHeaders] {{range $k, $v := $headers.SSLProxyHeaders }} {{$k}} = "{{$v}}" {{end}} {{end}} {{end}} [frontends."{{ $frontendName }}".routes."route-host{{ $app.ID | replace "/" "-" }}{{ getServiceNameSuffix $serviceName }}"] rule = "{{ getFrontendRule $app $serviceName }}" {{end}} {{end}} `) func templatesMarathonTmplBytes() ([]byte, error) { return _templatesMarathonTmpl, nil } func templatesMarathonTmpl() (*asset, error) { bytes, err := templatesMarathonTmplBytes() if err != nil { return nil, err } info := bindataFileInfo{name: "templates/marathon.tmpl", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} a := &asset{bytes: bytes, info: info} return a, nil } var _templatesMesosTmpl = []byte(`{{$apps := .Applications}} [backends]{{range .Tasks}} [backends.backend{{getBackend . $apps}}.servers.server-{{getID .}}] url = "{{getProtocol . $apps}}://{{getHost .}}:{{getPort . $apps}}" weight = {{getWeight . $apps}} {{end}} [frontends]{{range .Applications}} [frontends.frontend-{{getFrontEndName .}}] backend = "backend{{getFrontendBackend .}}" passHostHeader = {{getPassHostHeader .}} priority = {{getPriority .}} entryPoints = [{{range getEntryPoints .}} "{{.}}", {{end}}] [frontends.frontend-{{getFrontEndName .}}.routes.route-host{{getFrontEndName .}}] rule = "{{getFrontendRule .}}" {{end}} `) func templatesMesosTmplBytes() ([]byte, error) { return _templatesMesosTmpl, nil } func templatesMesosTmpl() (*asset, error) { bytes, err := templatesMesosTmplBytes() if err != nil { return nil, err } info := bindataFileInfo{name: "templates/mesos.tmpl", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} a := &asset{bytes: bytes, info: info} return a, nil } var _templatesNotfoundTmpl = []byte(`