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

@ -40,6 +40,7 @@ func (p *Provider) buildConfiguration(catalog []catalogUpdate) *types.Configurat
"getLoadBalancer": p.getLoadBalancer,
"getMaxConn": p.getMaxConn,
"getHealthCheck": p.getHealthCheck,
"getBuffering": p.getBuffering,
// Frontend functions
"getFrontendRule": p.getFrontendRule,
@ -296,6 +297,20 @@ func (p *Provider) getHealthCheck(tags []string) *types.HealthCheck {
}
}
func (p *Provider) getBuffering(tags []string) *types.Buffering {
if !p.hasAttributePrefix(label.SuffixBackendBuffering, tags) {
return nil
}
return &types.Buffering{
MaxRequestBodyBytes: p.getInt64Attribute(label.SuffixBackendBufferingMaxRequestBodyBytes, tags, 0),
MaxResponseBodyBytes: p.getInt64Attribute(label.SuffixBackendBufferingMaxResponseBodyBytes, tags, 0),
MemRequestBodyBytes: p.getInt64Attribute(label.SuffixBackendBufferingMemRequestBodyBytes, tags, 0),
MemResponseBodyBytes: p.getInt64Attribute(label.SuffixBackendBufferingMemResponseBodyBytes, tags, 0),
RetryExpression: p.getAttribute(label.SuffixBackendBufferingRetryExpression, tags, ""),
}
}
func (p *Provider) getRedirect(tags []string) *types.Redirect {
if p.hasAttribute(label.SuffixFrontendRedirectEntryPoint, tags) {
return &types.Redirect{