1
0
Fork 0

Request buffering middleware

This commit is contained in:
Łukasz Harasimowicz 2018-01-31 15:32:04 +01:00 committed by Traefiker
parent d426126a92
commit a81171d5f1
44 changed files with 2155 additions and 5 deletions

View file

@ -32,6 +32,7 @@ func (p *Provider) buildConfiguration() *types.Configuration {
"getLoadBalancer": getLoadBalancer,
"getMaxConn": getMaxConn,
"getHealthCheck": getHealthCheck,
"getBuffering": getBuffering,
"getServers": p.getServers,
// TODO Deprecated [breaking]
@ -455,6 +456,20 @@ func getHealthCheck(application marathon.Application) *types.HealthCheck {
}
}
func getBuffering(application marathon.Application) *types.Buffering {
if !label.HasPrefixP(application.Labels, label.TraefikBackendBuffering) {
return nil
}
return &types.Buffering{
MaxRequestBodyBytes: label.GetInt64ValueP(application.Labels, label.TraefikBackendBufferingMaxRequestBodyBytes, 0),
MaxResponseBodyBytes: label.GetInt64ValueP(application.Labels, label.TraefikBackendBufferingMaxResponseBodyBytes, 0),
MemRequestBodyBytes: label.GetInt64ValueP(application.Labels, label.TraefikBackendBufferingMemRequestBodyBytes, 0),
MemResponseBodyBytes: label.GetInt64ValueP(application.Labels, label.TraefikBackendBufferingMemResponseBodyBytes, 0),
RetryExpression: label.GetStringValueP(application.Labels, label.TraefikBackendBufferingRetryExpression, ""),
}
}
func (p *Provider) getServers(application marathon.Application, serviceName string) map[string]types.Server {
var servers map[string]types.Server