Versions in this module Expand all Collapse all v3 v3.43.5 Jun 9, 2024 Changes in this version + const ClientPreface + const NextProtoTLS + var DebugGoroutines = os.Getenv("DEBUG_HTTP2_GOROUTINES") == "1" + var ErrNoCachedConn error = noCachedConnError + var VerboseLogs bool + func IsNoCachedConnError(err error) bool + type ClientConn struct + func (cc *ClientConn) CanTakeNewRequest() bool + func (cc *ClientConn) Close() error + func (cc *ClientConn) Ping(ctx context.Context) error + func (cc *ClientConn) ReserveNewRequest() bool + func (cc *ClientConn) RoundTrip(req *http.Request) (*http.Response, error) + func (cc *ClientConn) SetDoNotReuse() + func (cc *ClientConn) Shutdown(ctx context.Context) error + type ClientConnPool interface + AddConnIfNeeded func(key string, t *Transport, c net.Conn) (used bool, err error) + CloseIdleConnections func() + GetClientConn func(req *http.Request, addr string, dialOnMiss bool) (*ClientConn, error) + MarkDead func(*ClientConn) + type ClientConnState struct + Closed bool + Closing bool + LastIdle time.Time + MaxConcurrentStreams uint32 + StreamsActive int + StreamsPending int + StreamsReserved int + type ConnectionError ErrCode + func (e ConnectionError) Error() string + type ContinuationFrame struct + func (f *ContinuationFrame) HeaderBlockFragment() []byte + func (f *ContinuationFrame) HeadersEnded() bool + type DataFrame struct + func (f *DataFrame) Data() []byte + func (f *DataFrame) StreamEnded() bool + type ErrCode uint32 + const ErrCodeCancel + const ErrCodeCompression + const ErrCodeConnect + const ErrCodeEnhanceYourCalm + const ErrCodeFlowControl + const ErrCodeFrameSize + const ErrCodeHTTP11Required + const ErrCodeInadequateSecurity + const ErrCodeInternal + const ErrCodeNo + const ErrCodeProtocol + const ErrCodeRefusedStream + const ErrCodeSettingsTimeout + const ErrCodeStreamClosed + func (e ErrCode) String() string + type Flags uint8 + const FlagContinuationEndHeaders + const FlagDataEndStream + const FlagDataPadded + const FlagHeadersEndHeaders + const FlagHeadersEndStream + const FlagHeadersPadded + const FlagHeadersPriority + const FlagPingAck + const FlagPushPromiseEndHeaders + const FlagPushPromisePadded + const FlagSettingsAck + func (f Flags) Has(v Flags) bool + type Frame interface + Header func() FrameHeader + type FrameHeader struct + Flags Flags + Length uint32 + StreamID uint32 + Type FrameType + func ReadFrameHeader(r io.Reader) (FrameHeader, error) + func (h FrameHeader) Header() FrameHeader + func (h FrameHeader) String() string + type FrameType uint8 + const FrameContinuation + const FrameData + const FrameGoAway + const FrameHeaders + const FramePing + const FramePriority + const FramePushPromise + const FrameRSTStream + const FrameSettings + const FrameWindowUpdate + func (t FrameType) String() string + type Framer struct + AllowIllegalReads bool + AllowIllegalWrites bool + MaxHeaderListSize uint32 + ReadMetaHeaders *hpack.Decoder + func NewFramer(w io.Writer, r io.Reader) *Framer + func (h2f *Framer) ErrorDetail() error + func (h2f *Framer) ReadFrame() (Frame, error) + func (h2f *Framer) SetMaxReadFrameSize(v uint32) + func (h2f *Framer) SetReuseFrames() + func (h2f *Framer) WriteContinuation(streamID uint32, endHeaders bool, headerBlockFragment []byte) error + func (h2f *Framer) WriteData(streamID uint32, endStream bool, data []byte) error + func (h2f *Framer) WriteDataPadded(streamID uint32, endStream bool, data, pad []byte) error + func (h2f *Framer) WriteGoAway(maxStreamID uint32, code ErrCode, debugData []byte) error + func (h2f *Framer) WriteHeaders(p HeadersFrameParam) error + func (h2f *Framer) WritePing(ack bool, data [8]byte) error + func (h2f *Framer) WritePriority(streamID uint32, p http2.PriorityParam) error + func (h2f *Framer) WritePushPromise(p PushPromiseParam) error + func (h2f *Framer) WriteRSTStream(streamID uint32, code ErrCode) error + func (h2f *Framer) WriteRawFrame(t FrameType, flags Flags, streamID uint32, payload []byte) error + func (h2f *Framer) WriteSettings(settings ...http2.Setting) error + func (h2f *Framer) WriteSettingsAck() error + func (h2f *Framer) WriteWindowUpdate(streamID, incr uint32) error + type GoAwayError struct + DebugData string + ErrCode ErrCode + LastStreamID uint32 + func (e GoAwayError) Error() string + type GoAwayFrame struct + ErrCode ErrCode + LastStreamID uint32 + func (f *GoAwayFrame) DebugData() []byte + type GzipReader struct + Body io.ReadCloser + func (gz *GzipReader) Close() error + func (gz *GzipReader) Read(p []byte) (n int, err error) + type HeadersFrame struct + Priority http2.PriorityParam + func (f *HeadersFrame) HasPriority() bool + func (f *HeadersFrame) HeaderBlockFragment() []byte + func (f *HeadersFrame) HeadersEnded() bool + func (f *HeadersFrame) StreamEnded() bool + type HeadersFrameParam struct + BlockFragment []byte + EndHeaders bool + EndStream bool + PadLength uint8 + Priority http2.PriorityParam + StreamID uint32 + type MetaHeadersFrame struct + Fields []hpack.HeaderField + Truncated bool + func (mh *MetaHeadersFrame) PseudoFields() []hpack.HeaderField + func (mh *MetaHeadersFrame) PseudoValue(pseudo string) string + func (mh *MetaHeadersFrame) RegularFields() []hpack.HeaderField + type PingFrame struct + Data [8]byte + func (f *PingFrame) IsAck() bool + type PriorityFrame struct + type PushPromiseFrame struct + PromiseID uint32 + func (f *PushPromiseFrame) HeaderBlockFragment() []byte + func (f *PushPromiseFrame) HeadersEnded() bool + type PushPromiseParam struct + BlockFragment []byte + EndHeaders bool + PadLength uint8 + PromiseID uint32 + StreamID uint32 + type RSTStreamFrame struct + ErrCode ErrCode + type RoundTripOpt struct + OnlyCachedConn bool + type SettingsFrame struct + func (f *SettingsFrame) ForeachSetting(fn func(http2.Setting) error) error + func (f *SettingsFrame) HasDuplicates() bool + func (f *SettingsFrame) IsAck() bool + func (f *SettingsFrame) NumSettings() int + func (f *SettingsFrame) Setting(i int) http2.Setting + func (f *SettingsFrame) Value(id http2.SettingID) (v uint32, ok bool) + type StreamError struct + Cause error + Code ErrCode + StreamID uint32 + func (e StreamError) Error() string + type Transport struct + AllowHTTP bool + ConnPool ClientConnPool + ConnectionFlow uint32 + CountError func(errType string) + DialTLS func(network, addr string, cfg *tls.Config) (net.Conn, error) + HeaderPriority http2.PriorityParam + MaxHeaderListSize uint32 + PingTimeout time.Duration + PriorityFrames []http2.PriorityFrame + ReadIdleTimeout time.Duration + Settings []http2.Setting + StrictMaxConcurrentStreams bool + WriteByteTimeout time.Duration + func (t *Transport) AddConn(conn net.Conn, addr string) (used bool, err error) + func (t *Transport) CloseIdleConnections() + func (t *Transport) NewClientConn(c net.Conn) (*ClientConn, error) + func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) + func (t *Transport) RoundTripOnlyCachedConn(req *http.Request) (*http.Response, error) + func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Response, error) + type UnknownFrame struct + func (f *UnknownFrame) Payload() []byte + type WindowUpdateFrame struct + Increment uint32