-
Notifications
You must be signed in to change notification settings - Fork 5
/
config.go
33 lines (29 loc) · 878 Bytes
/
config.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
package tos
import "time"
type Config struct {
Endpoint string
Region string
TransportConfig TransportConfig
}
func defaultConfig() Config {
return Config{
TransportConfig: DefaultTransportConfig(),
}
}
func DefaultTransportConfig() TransportConfig {
highLatencyLogThreshold := DefaultHighLatencyLogThreshold
return TransportConfig{
MaxIdleConns: 1024,
MaxIdleConnsPerHost: 1024,
MaxConnsPerHost: 1024,
DialTimeout: 10 * time.Second,
KeepAlive: 30 * time.Second,
IdleConnTimeout: 60 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ResponseHeaderTimeout: 60 * time.Second,
ExpectContinueTimeout: 3 * time.Second,
ReadTimeout: 30 * time.Second,
WriteTimeout: 30 * time.Second,
HighLatencyLogThreshold: &highLatencyLogThreshold,
}
}