kubernetes/vendor/golang.org/x/net/http2/transport.go

const transportDefaultConnFlow

const transportDefaultStreamFlow

const defaultUserAgent

const initialMaxConcurrentStreams

const defaultMaxConcurrentStreams

type Transport

type transportTestHooks

func (t *Transport) markNewGoroutine() {}

// newTimer creates a new time.Timer, or a synthetic timer in tests.
func (t *Transport) newTimer(d time.Duration) timer {}

// afterFunc creates a new time.AfterFunc timer, or a synthetic timer in tests.
func (t *Transport) afterFunc(d time.Duration, f func()) timer {}

func (t *Transport) contextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) {}

func (t *Transport) maxHeaderListSize() uint32 {}

func (t *Transport) disableCompression() bool {}

// ConfigureTransport configures a net/http HTTP/1 Transport to use HTTP/2.
// It returns an error if t1 has already been HTTP/2-enabled.
//
// Use ConfigureTransports instead to configure the HTTP/2 Transport.
func ConfigureTransport(t1 *http.Transport) error {}

// ConfigureTransports configures a net/http HTTP/1 Transport to use HTTP/2.
// It returns a new HTTP/2 Transport for further configuration.
// It returns an error if t1 has already been HTTP/2-enabled.
func ConfigureTransports(t1 *http.Transport) (*Transport, error) {}

func configureTransports(t1 *http.Transport) (*Transport, error) {}

func (t *Transport) connPool() ClientConnPool {}

func (t *Transport) initConnPool() {}

type ClientConn

type clientStream

var got1xxFuncForTests

// get1xxTraceFunc returns the value of request's httptrace.ClientTrace.Got1xxResponse func,
// if any. It returns nil if not set or if the Go version is too old.
func (cs *clientStream) get1xxTraceFunc() func(int, textproto.MIMEHeader) error {}

func (cs *clientStream) abortStream(err error) {}

func (cs *clientStream) abortStreamLocked(err error) {}

func (cs *clientStream) abortRequestBodyWrite() {}

func (cs *clientStream) closeReqBodyLocked() {}

type stickyErrWriter

func (sew stickyErrWriter) Write(p []byte) (n int, err error) {}

type noCachedConnError

func (noCachedConnError) IsHTTP2NoCachedConnError() {}

func (noCachedConnError) Error() string             {}

// isNoCachedConnError reports whether err is of type noCachedConnError
// or its equivalent renamed type in net/http2's h2_bundle.go. Both types
// may coexist in the same running program.
func isNoCachedConnError(err error) bool {}

var ErrNoCachedConn

type RoundTripOpt

func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) {}

// authorityAddr returns a given authority (a host/IP, or host:port / ip:port)
// and returns a host:port. The port 443 is added if needed.
func authorityAddr(scheme string, authority string) (addr string) {}

// RoundTripOpt is like RoundTrip, but takes options.
func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Response, error) {}

// CloseIdleConnections closes any connections which were previously
// connected from previous requests but are now sitting idle.
// It does not interrupt any connections currently in use.
func (t *Transport) CloseIdleConnections() {}

var errClientConnClosed

var errClientConnUnusable

var errClientConnGotGoAway

// shouldRetryRequest is called by RoundTrip when a request fails to get
// response headers. It is always called with a non-nil error.
// It returns either a request to retry (either the same request, or a
// modified clone), or an error if the request can't be replayed.
func shouldRetryRequest(req *http.Request, err error) (*http.Request, error) {}

func canRetryError(err error) bool {}

func (t *Transport) dialClientConn(ctx context.Context, addr string, singleUse bool) (*ClientConn, error) {}

func (t *Transport) newTLSConfig(host string) *tls.Config {}

func (t *Transport) dialTLS(ctx context.Context, network, addr string, tlsCfg *tls.Config) (net.Conn, error) {}

// disableKeepAlives reports whether connections should be closed as
// soon as possible after handling the first request.
func (t *Transport) disableKeepAlives() bool {}

func (t *Transport) expectContinueTimeout() time.Duration {}

func (t *Transport) NewClientConn(c net.Conn) (*ClientConn, error) {}

func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, error) {}

func (cc *ClientConn) healthCheck() {}

// SetDoNotReuse marks cc as not reusable for future HTTP requests.
func (cc *ClientConn) SetDoNotReuse() {}

func (cc *ClientConn) setGoAway(f *GoAwayFrame) {}

// CanTakeNewRequest reports whether the connection can take a new request,
// meaning it has not been closed or received or sent a GOAWAY.
//
// If the caller is going to immediately make a new request on this
// connection, use ReserveNewRequest instead.
func (cc *ClientConn) CanTakeNewRequest() bool {}

// ReserveNewRequest is like CanTakeNewRequest but also reserves a
// concurrent stream in cc. The reservation is decremented on the
// next call to RoundTrip.
func (cc *ClientConn) ReserveNewRequest() bool {}

type ClientConnState

// State returns a snapshot of cc's state.
func (cc *ClientConn) State() ClientConnState {}

type clientConnIdleState

func (cc *ClientConn) idleState() clientConnIdleState {}

func (cc *ClientConn) idleStateLocked() (st clientConnIdleState) {}

func (cc *ClientConn) canTakeNewRequestLocked() bool {}

// tooIdleLocked reports whether this connection has been been sitting idle
// for too much wall time.
func (cc *ClientConn) tooIdleLocked() bool {}

// onIdleTimeout is called from a time.AfterFunc goroutine. It will
// only be called when we're idle, but because we're coming from a new
// goroutine, there could be a new request coming in at the same time,
// so this simply calls the synchronized closeIfIdle to shut down this
// connection. The timer could just call closeIfIdle, but this is more
// clear.
func (cc *ClientConn) onIdleTimeout() {}

func (cc *ClientConn) closeConn() {}

// A tls.Conn.Close can hang for a long time if the peer is unresponsive.
// Try to shut it down more aggressively.
func (cc *ClientConn) forceCloseConn() {}

func (cc *ClientConn) closeIfIdle() {}

func (cc *ClientConn) isDoNotReuseAndIdle() bool {}

var shutdownEnterWaitStateHook

// Shutdown gracefully closes the client connection, waiting for running streams to complete.
func (cc *ClientConn) Shutdown(ctx context.Context) error {}

func (cc *ClientConn) sendGoAway() error {}

// closes the client connection immediately. In-flight requests are interrupted.
// err is sent to streams.
func (cc *ClientConn) closeForError(err error) {}

// Close closes the client connection immediately.
//
// In-flight requests are interrupted. For a graceful shutdown, use Shutdown instead.
func (cc *ClientConn) Close() error {}

// closes the client connection immediately. In-flight requests are interrupted.
func (cc *ClientConn) closeForLostPing() {}

var errRequestCanceled

func commaSeparatedTrailers(req *http.Request) (string, error) {}

func (cc *ClientConn) responseHeaderTimeout() time.Duration {}

// checkConnHeaders checks whether req has any invalid connection-level headers.
// per RFC 7540 section 8.1.2.2: Connection-Specific Header Fields.
// Certain headers are special-cased as okay but not transmitted later.
func checkConnHeaders(req *http.Request) error {}

// actualContentLength returns a sanitized version of
// req.ContentLength, where 0 actually means zero (not unknown) and -1
// means unknown.
func actualContentLength(req *http.Request) int64 {}

func (cc *ClientConn) decrStreamReservations() {}

func (cc *ClientConn) decrStreamReservationsLocked() {}

func (cc *ClientConn) RoundTrip(req *http.Request) (*http.Response, error) {}

func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream)) (*http.Response, error) {}

// doRequest runs for the duration of the request lifetime.
//
// It sends the request and performs post-request cleanup (closing Request.Body, etc.).
func (cs *clientStream) doRequest(req *http.Request, streamf func(*clientStream)) {}

// writeRequest sends a request.
//
// It returns nil after the request is written, the response read,
// and the request stream is half-closed by the peer.
//
// It returns non-nil if the request ends otherwise.
// If the returned error is StreamError, the error Code may be used in resetting the stream.
func (cs *clientStream) writeRequest(req *http.Request, streamf func(*clientStream)) (err error) {}

func (cs *clientStream) encodeAndWriteHeaders(req *http.Request) error {}

// cleanupWriteRequest performs post-request tasks.
//
// If err (the result of writeRequest) is non-nil and the stream is not closed,
// cleanupWriteRequest will send a reset to the peer.
func (cs *clientStream) cleanupWriteRequest(err error) {}

// awaitOpenSlotForStreamLocked waits until len(streams) < maxConcurrentStreams.
// Must hold cc.mu.
func (cc *ClientConn) awaitOpenSlotForStreamLocked(cs *clientStream) error {}

// requires cc.wmu be held
func (cc *ClientConn) writeHeaders(streamID uint32, endStream bool, maxFrameSize int, hdrs []byte) error {}

var errStopReqBodyWrite

var errStopReqBodyWriteAndCancel

var errReqBodyTooLong

// frameScratchBufferLen returns the length of a buffer to use for
// outgoing request bodies to read/write to/from.
//
// It returns max(1, min(peer's advertised max frame size,
// Request.ContentLength+1, 512KB)).
func (cs *clientStream) frameScratchBufferLen(maxFrameSize int) int {}

var bufPools

func bufPoolIndex(size int) int {}

func (cs *clientStream) writeRequestBody(req *http.Request) (err error) {}

// awaitFlowControl waits for [1, min(maxBytes, cc.cs.maxFrameSize)] flow
// control tokens from the server.
// It returns either the non-zero number of tokens taken or an error
// if the stream is dead.
func (cs *clientStream) awaitFlowControl(maxBytes int) (taken int32, err error) {}

func validateHeaders(hdrs http.Header) string {}

var errNilRequestURL

// requires cc.wmu be held.
func (cc *ClientConn) encodeHeaders(req *http.Request, addGzipHeader bool, trailers string, contentLength int64) ([]byte, error) {}

// shouldSendReqContentLength reports whether the http2.Transport should send
// a "content-length" request header. This logic is basically a copy of the net/http
// transferWriter.shouldSendContentLength.
// The contentLength is the corrected contentLength (so 0 means actually 0, not unknown).
// -1 means unknown.
func shouldSendReqContentLength(method string, contentLength int64) bool {}

// requires cc.wmu be held.
func (cc *ClientConn) encodeTrailers(trailer http.Header) ([]byte, error) {}

func (cc *ClientConn) writeHeader(name, value string) {}

type resAndError

// requires cc.mu be held.
func (cc *ClientConn) addStreamLocked(cs *clientStream) {}

func (cc *ClientConn) forgetStreamID(id uint32) {}

type clientConnReadLoop

// readLoop runs in its own goroutine and reads and dispatches frames.
func (cc *ClientConn) readLoop() {}

type GoAwayError

func (e GoAwayError) Error() string {}

func isEOFOrNetReadError(err error) bool {}

func (rl *clientConnReadLoop) cleanup() {}

// countReadFrameError calls Transport.CountError with a string
// representing err.
func (cc *ClientConn) countReadFrameError(err error) {}

func (rl *clientConnReadLoop) run() error {}

func (rl *clientConnReadLoop) processHeaders(f *MetaHeadersFrame) error {}

// may return error types nil, or ConnectionError. Any other error value
// is a StreamError of type ErrCodeProtocol. The returned error in that case
// is the detail.
//
// As a special case, handleResponse may return (nil, nil) to skip the
// frame (currently only used for 1xx responses).
func (rl *clientConnReadLoop) handleResponse(cs *clientStream, f *MetaHeadersFrame) (*http.Response, error) {}

func (rl *clientConnReadLoop) processTrailers(cs *clientStream, f *MetaHeadersFrame) error {}

type transportResponseBody

func (b transportResponseBody) Read(p []byte) (n int, err error) {}

var errClosedResponseBody

func (b transportResponseBody) Close() error {}

func (rl *clientConnReadLoop) processData(f *DataFrame) error {}

func (rl *clientConnReadLoop) endStream(cs *clientStream) {}

func (rl *clientConnReadLoop) endStreamError(cs *clientStream, err error) {}

func (rl *clientConnReadLoop) streamByID(id uint32) *clientStream {}

func (cs *clientStream) copyTrailers() {}

func (rl *clientConnReadLoop) processGoAway(f *GoAwayFrame) error {}

func (rl *clientConnReadLoop) processSettings(f *SettingsFrame) error {}

func (rl *clientConnReadLoop) processSettingsNoWrite(f *SettingsFrame) error {}

func (rl *clientConnReadLoop) processWindowUpdate(f *WindowUpdateFrame) error {}

func (rl *clientConnReadLoop) processResetStream(f *RSTStreamFrame) error {}

// Ping sends a PING frame to the server and waits for the ack.
func (cc *ClientConn) Ping(ctx context.Context) error {}

func (rl *clientConnReadLoop) processPing(f *PingFrame) error {}

func (rl *clientConnReadLoop) processPushPromise(f *PushPromiseFrame) error {}

func (cc *ClientConn) writeStreamReset(streamID uint32, code ErrCode, err error) {}

var errResponseHeaderListSize

var errRequestHeaderListSize

func (cc *ClientConn) logf(format string, args ...interface{}

func (cc *ClientConn) vlogf(format string, args ...interface{}

func (t *Transport) vlogf(format string, args ...interface{}

func (t *Transport) logf(format string, args ...interface{}

var noBody

type noBodyReader

func (noBodyReader) Close() error             {}

func (noBodyReader) Read([]byte) (int, error) {}

type missingBody

func (missingBody) Close() error             {}

func (missingBody) Read([]byte) (int, error) {}

func strSliceContains(ss []string, s string) bool {}

type erringRoundTripper

func (rt erringRoundTripper) RoundTripErr() error                             {}

func (rt erringRoundTripper) RoundTrip(*http.Request) (*http.Response, error) {}

type gzipReader

func (gz *gzipReader) Read(p []byte) (n int, err error) {}

func (gz *gzipReader) Close() error {}

type errorReader

func (r errorReader) Read(p []byte) (int, error) {}

// isConnectionCloseRequest reports whether req should use its own
// connection for a single request and then close the connection.
func isConnectionCloseRequest(req *http.Request) bool {}

// registerHTTPSProtocol calls Transport.RegisterProtocol but
// converting panics into errors.
func registerHTTPSProtocol(t *http.Transport, rt noDialH2RoundTripper) (err error) {}

type noDialH2RoundTripper

func (rt noDialH2RoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {}

func (t *Transport) idleConnTimeout() time.Duration {}

func traceGetConn(req *http.Request, hostPort string) {}

func traceGotConn(req *http.Request, cc *ClientConn, reused bool) {}

func traceWroteHeaders(trace *httptrace.ClientTrace) {}

func traceGot100Continue(trace *httptrace.ClientTrace) {}

func traceWait100Continue(trace *httptrace.ClientTrace) {}

func traceWroteRequest(trace *httptrace.ClientTrace, err error) {}

func traceFirstResponseByte(trace *httptrace.ClientTrace) {}

func traceHasWroteHeaderField(trace *httptrace.ClientTrace) bool {}

func traceWroteHeaderField(trace *httptrace.ClientTrace, k, v string) {}

func traceGot1xxResponseFunc(trace *httptrace.ClientTrace) func(int, textproto.MIMEHeader) error {}

// dialTLSWithContext uses tls.Dialer, added in Go 1.15, to open a TLS
// connection.
func (t *Transport) dialTLSWithContext(ctx context.Context, network, addr string, cfg *tls.Config) (*tls.Conn, error) {}