forked from go-resty/resty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default_values.go
40 lines (33 loc) · 879 Bytes
/
default_values.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**
* @note
* default.go
*
* @author songtianming
* @date 2020-09-10
*/
package resty
import "time"
//Retry
var (
DefaultMaxRetries = 3
DefaultWaitTime = time.Duration(100) * time.Millisecond
DefaultMaxWaitTime = time.Duration(2000) * time.Millisecond
)
func SetDefaultMaxRetries(retry int) {
DefaultMaxRetries = retry
}
func SetDefaultRetryWaitTime(waitTime time.Duration) {
DefaultWaitTime = waitTime
}
func SetDefaultMaxRetryWaitTime(maxWaitTime time.Duration) {
DefaultMaxWaitTime = maxWaitTime
}
//Transport
var (
DefaultTransportTimeout = 30 * time.Second
DefaultTransportKeepAlive = 30 * time.Second
DefaultTransportMaxIdleConns = 100
DefaultTransportIdleConnTimeout = 90 * time.Second
DefaultTransportTLSHandshakeTimeout = 10 * time.Second
DefaultTransportExpectContinueTimeout = 1 * time.Second
)