-
Notifications
You must be signed in to change notification settings - Fork 843
Expand file tree
/
Copy pathtimeout_types.go
More file actions
128 lines (109 loc) · 4.68 KB
/
Copy pathtimeout_types.go
File metadata and controls
128 lines (109 loc) · 4.68 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.
package v1alpha1
import gwapiv1 "sigs.k8s.io/gateway-api/apis/v1"
// Timeout defines configuration for timeouts related to connections.
type Timeout struct {
// Timeout settings for TCP.
//
// +optional
TCP *TCPTimeout `json:"tcp,omitempty"`
// Timeout settings for HTTP.
//
// +optional
HTTP *HTTPTimeout `json:"http,omitempty"`
}
type TCPTimeout struct {
// The timeout for network connection establishment, including TCP and TLS handshakes.
// Default: 10 seconds.
//
// +optional
ConnectTimeout *gwapiv1.Duration `json:"connectTimeout,omitempty"`
}
type HTTPTimeout struct {
// The idle timeout for an HTTP connection. Idle time is defined as a period in which there are no active requests in the connection.
// Default: 1 hour.
//
// +optional
ConnectionIdleTimeout *gwapiv1.Duration `json:"connectionIdleTimeout,omitempty"`
// The maximum duration of an HTTP connection.
// Default: unlimited.
//
// +optional
MaxConnectionDuration *gwapiv1.Duration `json:"maxConnectionDuration,omitempty"`
// RequestTimeout is the time until which entire response is received from the upstream.
//
// +optional
RequestTimeout *gwapiv1.Duration `json:"requestTimeout,omitempty" yaml:"requestTimeout,omitempty"`
// MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time
// from when the request is sent until the response stream is fully consumed and does not apply to
// non-streaming requests.
// When set to "0s", no max duration is applied and streams can run indefinitely.
//
// +optional
MaxStreamDuration *gwapiv1.Duration `json:"maxStreamDuration,omitempty"`
// The stream idle timeout defines the amount of time a stream can exist without any upstream or downstream activity.
// If not specified, StreamIdleTimeout is inherited from the listener-level setting, which can be configured via ClientTrafficPolicy.
//
// +optional
StreamIdleTimeout *gwapiv1.Duration `json:"streamIdleTimeout,omitempty"`
}
type ClientTimeout struct {
// Timeout settings for TCP.
//
// +optional
TCP *TCPClientTimeout `json:"tcp,omitempty"`
// Timeout settings for HTTP.
//
// +optional
HTTP *HTTPClientTimeout `json:"http,omitempty"`
// ListenerFiltersTimeout is the duration envoy waits for all listener filters to complete operation.
// If the timeout is reached, the accepted socket is closed without a connection being created.
// Specify 0 to disable the timeout.
// Default: 15 seconds.
//
// +optional
ListenerFiltersTimeout *gwapiv1.Duration `json:"listenerFiltersTimeout,omitempty"`
}
// TCPClientTimeout only provides timeout configuration on the listener whose protocol is TCP or TLS.
type TCPClientTimeout struct {
// IdleTimeout for a TCP connection. Idle time is defined as a period in which there are no
// bytes sent or received on either the upstream or downstream connection.
// Default: 1 hour.
//
// +optional
IdleTimeout *gwapiv1.Duration `json:"idleTimeout,omitempty"`
// TransportSocketConnectTimeout is the duration envoy waits for incoming connections to complete any transport socket negotiations.
// If this expires before the transport reports connection establishment, the connection is summarily closed.
// Default: 5 seconds.
//
// +optional
TransportSocketConnectTimeout *gwapiv1.Duration `json:"transportSocketConnectTimeout,omitempty"`
}
type HTTPClientTimeout struct {
// RequestReceivedTimeout is the duration envoy waits for the complete request reception. This timer starts upon request
// initiation and stops when either the last byte of the request is sent upstream or when the response begins.
//
// +optional
RequestReceivedTimeout *gwapiv1.Duration `json:"requestReceivedTimeout,omitempty"`
// IdleTimeout for an HTTP connection. Idle time is defined as a period in which there are no active requests in the connection.
// Default: 1 hour.
//
// +optional
IdleTimeout *gwapiv1.Duration `json:"idleTimeout,omitempty"`
// The stream idle timeout defines the amount of time a stream can exist without any upstream or downstream activity.
// Default: 5 minutes.
//
// +optional
StreamIdleTimeout *gwapiv1.Duration `json:"streamIdleTimeout,omitempty"`
// RequestHeadersTimeout is the duration envoy waits for the request headers to arrive.
// The timer is activated when the first byte of the headers is received,
// and is disarmed when the last byte of the headers has been received.
// Specify 0 to disable the timeout.
// Default: 10 seconds.
//
// +optional
RequestHeadersTimeout *gwapiv1.Duration `json:"requestHeadersTimeout,omitempty"`
}