Versions in this module Expand all Collapse all v0 v0.28.1 Aug 29, 2024 Changes in this version + const ClientPreface + const NextProtoTLS + const TrailerPrefix + var DebugGoroutines = os.Getenv("DEBUG_HTTP2_GOROUTINES") == "1" + var ErrFrameTooLarge = errors.New("http2: frame too large") + var ErrNoCachedConn error = noCachedConnError + var ErrPushLimitReached = errors.New("http2: push would exceed peer's SETTINGS_MAX_CONCURRENT_STREAMS") + var ErrRecursivePush = errors.New("http2: recursive push not allowed") + var VerboseLogs bool + func ConfigureServer(s *http.Server, conf *Server) error + func ConfigureTransport(t1 *http.Transport) error + 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 + func (cc *ClientConn) State() ClientConnState + type ClientConnPool interface + GetClientConn func(req *http.Request, addr string) (*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 FrameWriteRequest struct + func (wr FrameWriteRequest) Consume(n int32) (FrameWriteRequest, FrameWriteRequest, int) + func (wr FrameWriteRequest) DataSize() int + func (wr FrameWriteRequest) StreamID() uint32 + func (wr FrameWriteRequest) String() string + type Framer struct + AllowIllegalReads bool + AllowIllegalWrites bool + MaxHeaderListSize uint32 + ReadMetaHeaders *hpack.Decoder + func NewFramer(w io.Writer, r io.Reader) *Framer + func (f *Framer) WriteContinuation(streamID uint32, endHeaders bool, headerBlockFragment []byte) error + func (f *Framer) WriteData(streamID uint32, endStream bool, data []byte) error + func (f *Framer) WriteDataPadded(streamID uint32, endStream bool, data, pad []byte) error + func (f *Framer) WriteGoAway(maxStreamID uint32, code ErrCode, debugData []byte) error + func (f *Framer) WriteHeaders(p HeadersFrameParam) error + func (f *Framer) WritePing(ack bool, data [8]byte) error + func (f *Framer) WritePriority(streamID uint32, p PriorityParam) error + func (f *Framer) WritePushPromise(p PushPromiseParam) error + func (f *Framer) WriteRSTStream(streamID uint32, code ErrCode) error + func (f *Framer) WriteRawFrame(t FrameType, flags Flags, streamID uint32, payload []byte) error + func (f *Framer) WriteSettings(settings ...Setting) error + func (f *Framer) WriteSettingsAck() error + func (f *Framer) WriteWindowUpdate(streamID, incr uint32) error + func (fr *Framer) ErrorDetail() error + func (fr *Framer) ReadFrame() (Frame, error) + func (fr *Framer) SetMaxReadFrameSize(v uint32) + func (fr *Framer) SetReuseFrames() + 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 HeadersFrame struct + Priority 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 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 OpenStreamOptions struct + PusherID uint32 + type PingFrame struct + Data [8]byte + func (f *PingFrame) IsAck() bool + type PriorityFrame struct + type PriorityParam struct + Exclusive bool + StreamDep uint32 + Weight uint8 + func (p PriorityParam) IsZero() bool + type PriorityWriteSchedulerConfig struct + MaxClosedNodesInTree int + MaxIdleNodesInTree int + ThrottleOutOfOrderWrites bool + 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 ServeConnOpts struct + BaseConfig *http.Server + Context context.Context + Handler http.Handler + SawClientPreface bool + Settings []byte + UpgradeRequest *http.Request + type Server struct + CountError func(errType string) + IdleTimeout time.Duration + MaxConcurrentStreams uint32 + MaxDecoderHeaderTableSize uint32 + MaxEncoderHeaderTableSize uint32 + MaxHandlers int + MaxReadFrameSize uint32 + MaxUploadBufferPerConnection int32 + MaxUploadBufferPerStream int32 + NewWriteScheduler func() WriteScheduler + PermitProhibitedCipherSuites bool + func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) + type Setting struct + ID SettingID + Val uint32 + func (s Setting) String() string + func (s Setting) Valid() error + type SettingID uint16 + const SettingEnablePush + const SettingHeaderTableSize + const SettingInitialWindowSize + const SettingMaxConcurrentStreams + const SettingMaxFrameSize + const SettingMaxHeaderListSize + func (s SettingID) String() string + type SettingsFrame struct + func (f *SettingsFrame) ForeachSetting(fn func(Setting) error) error + func (f *SettingsFrame) HasDuplicates() bool + func (f *SettingsFrame) IsAck() bool + func (f *SettingsFrame) NumSettings() int + func (f *SettingsFrame) Setting(i int) Setting + func (f *SettingsFrame) Value(id 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 + CountError func(errType string) + DialTLS func(network, addr string, cfg *tls.Config) (net.Conn, error) + DialTLSContext func(ctx context.Context, network, addr string, cfg *tls.Config) (net.Conn, error) + DisableCompression bool + IdleConnTimeout time.Duration + MaxDecoderHeaderTableSize uint32 + MaxEncoderHeaderTableSize uint32 + MaxHeaderListSize uint32 + MaxReadFrameSize uint32 + PingTimeout time.Duration + ReadIdleTimeout time.Duration + StrictMaxConcurrentStreams bool + TLSClientConfig *tls.Config + WriteByteTimeout time.Duration + func ConfigureTransports(t1 *http.Transport) (*Transport, 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) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Response, error) + type UnknownFrame struct + func (f *UnknownFrame) Payload() []byte + type WindowUpdateFrame struct + Increment uint32 + type WriteScheduler interface + AdjustStream func(streamID uint32, priority PriorityParam) + CloseStream func(streamID uint32) + OpenStream func(streamID uint32, options OpenStreamOptions) + Pop func() (wr FrameWriteRequest, ok bool) + Push func(wr FrameWriteRequest) + func NewPriorityWriteScheduler(cfg *PriorityWriteSchedulerConfig) WriteScheduler + func NewRandomWriteScheduler() WriteScheduler