File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ package nconf
2
+
3
+ import "time"
4
+
5
+ // HTTPServerTimeoutConfig represents common HTTP server timeout values
6
+ type HTTPServerTimeoutConfig struct {
7
+ // Read = http.Server.ReadTimeout
8
+ Read time.Duration `mapstructure:"read"`
9
+ // Write = http.Server.WriteTimeout
10
+ Write time.Duration `mapstructure:"write"`
11
+ // Handler = http.TimeoutHandler (or equivalent).
12
+ // The maximum amount of time a server handler can take.
13
+ Handler time.Duration `mapstructure:"handler"`
14
+ }
15
+
16
+ // HTTPClientTimeoutConfig represents common HTTP client timeout values
17
+ type HTTPClientTimeoutConfig struct {
18
+ // Dial = net.Dialer.Timeout
19
+ Dial time.Duration `mapstructure:"dial"`
20
+ // KeepAlive = net.Dialer.KeepAlive
21
+ KeepAlive time.Duration `mapstructure:"keep_alive" split_words:"true"`
22
+
23
+ // TLSHandshake = http.Transport.TLSHandshakeTimeout
24
+ TLSHandshake time.Duration `mapstructure:"tls_handshake" split_words:"true"`
25
+ // ResponseHeader = http.Transport.ResponseHeaderTimeout
26
+ ResponseHeader time.Duration `mapstructure:"response_header" split_words:"true"`
27
+ // Total = http.Client.Timeout or equivalent
28
+ // The maximum amount of time a client request can take.
29
+ Total time.Duration `mapstructure:"total"`
30
+ }
You can’t perform that action at this time.
0 commit comments