@@ -163,3 +163,68 @@ type Pusher interface {
163
163
// is not supported on the underlying connection.
164
164
Push (target string , opts * PushOptions ) error
165
165
}
166
+
167
+ // HTTP2Config defines HTTP/2 configuration parameters common to
168
+ // both [Transport] and [Server].
169
+ type HTTP2Config struct {
170
+ // MaxConcurrentStreams optionally specifies the number of
171
+ // concurrent streams that a peer may have open at a time.
172
+ // If zero, MaxConcurrentStreams defaults to at least 100.
173
+ MaxConcurrentStreams int
174
+
175
+ // MaxDecoderHeaderTableSize optionally specifies an upper limit for the
176
+ // size of the header compression table used for decoding headers sent
177
+ // by the peer.
178
+ // A valid value is less than 4MiB.
179
+ // If zero or invalid, a default value is used.
180
+ MaxDecoderHeaderTableSize int
181
+
182
+ // MaxEncoderHeaderTableSize optionally specifies an upper limit for the
183
+ // header compression table used for sending headers to the peer.
184
+ // A valid value is less than 4MiB.
185
+ // If zero or invalid, a default value is used.
186
+ MaxEncoderHeaderTableSize int
187
+
188
+ // MaxReadFrameSize optionally specifies the largest frame
189
+ // this endpoint is willing to read.
190
+ // A valid value is between 16KiB and 16MiB, inclusive.
191
+ // If zero or invalid, a default value is used.
192
+ MaxReadFrameSize int
193
+
194
+ // MaxReceiveBufferPerConnection is the maximum size of the
195
+ // flow control window for data received on a connection.
196
+ // A valid value is at least 64KiB and less than 4MiB.
197
+ // If invalid, a default value is used.
198
+ MaxReceiveBufferPerConnection int
199
+
200
+ // MaxReceiveBufferPerStream is the maximum size of
201
+ // the flow control window for data received on a stream (request).
202
+ // A valid value is less than 4MiB.
203
+ // If zero or invalid, a default value is used.
204
+ MaxReceiveBufferPerStream int
205
+
206
+ // SendPingTimeout is the timeout after which a health check using a ping
207
+ // frame will be carried out if no frame is received on a connection.
208
+ // If zero, no health check is performed.
209
+ SendPingTimeout time.Duration
210
+
211
+ // PingTimeout is the timeout after which a connection will be closed
212
+ // if a response to a ping is not received.
213
+ // If zero, a default of 15 seconds is used.
214
+ PingTimeout time.Duration
215
+
216
+ // WriteByteTimeout is the timeout after which a connection will be
217
+ // closed if no data can be written to it. The timeout begins when data is
218
+ // available to write, and is extended whenever any bytes are written.
219
+ WriteByteTimeout time.Duration
220
+
221
+ // PermitProhibitedCipherSuites, if true, permits the use of
222
+ // cipher suites prohibited by the HTTP/2 spec.
223
+ PermitProhibitedCipherSuites bool
224
+
225
+ // CountError, if non-nil, is called on HTTP/2 errors.
226
+ // It is intended to increment a metric for monitoring.
227
+ // The errType contains only lowercase letters, digits, and underscores
228
+ // (a-z, 0-9, _).
229
+ CountError func (errType string )
230
+ }
0 commit comments