This commit is contained in:
Alexander Klizhentas
2014-12-11 15:38:39 -08:00
parent 13d91e232c
commit ce6a7125fa
+13 -13
View File
@@ -12,21 +12,21 @@ Examples of a streaming middleware:
w.Write([]byte("hello"))
})
// Stream will read the body in buffer before passing the request to the handler
// calculate total size of the request and transform it from chunked encoding
// before passing to the server
stream.New(handler)
// Stream will read the body in buffer before passing the request to the handler
// calculate total size of the request and transform it from chunked encoding
// before passing to the server
stream.New(handler)
// This version will buffer up to 2MB in memory and will serialize any extra
//to a temporary file, if the request size exceeds 10MB it will reject the request
stream.New(handler,
MemRequestBodyBytes(2 * 1024 * 1024),
MaxRequestBodyBytes(10 * 1024 * 104))
// This version will buffer up to 2MB in memory and will serialize any extra
//to a temporary file, if the request size exceeds 10MB it will reject the request
stream.New(handler,
MemRequestBodyBytes(2 * 1024 * 1024),
MaxRequestBodyBytes(10 * 1024 * 104))
// Will do the same as above, but with responses
stream.New(handler,
MemResponseBodyBytes(2 * 1024 * 1024),
MaxResponseBodyBytes(10 * 1024 * 104))
// Will do the same as above, but with responses
stream.New(handler,
MemResponseBodyBytes(2 * 1024 * 1024),
MaxResponseBodyBytes(10 * 1024 * 104))
// Stream will replay the request if the handler returns error at least 3 times
// before returning the response