Add MaxIdemponentCallAttempts to fasthttp.Client (#484)

* Add MaxIdemponentCallAttempts to fasthttp.Client
This commit is contained in:
Blless
2018-11-29 18:06:36 +08:00
committed by Erik Dubbelboer
parent 5836521d82
commit 1d2d99cba3
+6
View File
@@ -188,6 +188,11 @@ type Client struct {
// after DefaultMaxIdleConnDuration.
MaxIdleConnDuration time.Duration
// Maximum number of attempts for idempotent calls
//
// DefaultMaxIdemponentCallAttempts is used if not set.
MaxIdemponentCallAttempts int
// Per-connection buffer size for responses' reading.
// This also limits the maximum header size.
//
@@ -400,6 +405,7 @@ func (c *Client) Do(req *Request, resp *Response) error {
TLSConfig: c.TLSConfig,
MaxConns: c.MaxConnsPerHost,
MaxIdleConnDuration: c.MaxIdleConnDuration,
MaxIdemponentCallAttempts: c.MaxIdemponentCallAttempts,
ReadBufferSize: c.ReadBufferSize,
WriteBufferSize: c.WriteBufferSize,
ReadTimeout: c.ReadTimeout,