WithMaxRetries returns a RequestOption that sets the maximum number of retries that the client attempts to make. When given 0, the client only makes one request. By default, the client retries two times. WithMaxRetries panics when retries is negative.
(retries int)
| 99 | // |
| 100 | // WithMaxRetries panics when retries is negative. |
| 101 | func WithMaxRetries(retries int) RequestOption { |
| 102 | if retries < 0 { |
| 103 | panic("option: cannot have fewer than 0 retries") |
| 104 | } |
| 105 | return requestconfig.RequestOptionFunc(func(r *requestconfig.RequestConfig) error { |
| 106 | r.MaxRetries = retries |
| 107 | return nil |
| 108 | }) |
| 109 | } |
| 110 | |
| 111 | // WithHeader returns a RequestOption that sets the header value to the associated key. It overwrites |
| 112 | // any value if there was one already present. |
nothing calls this directly
no test coverage detected
searching dependent graphs…