Versions in this module Expand all Collapse all v0 v0.3.0 Oct 2, 2026 v0.2.0 Sep 25, 2026 Changes in this version + const ClientPreface + const Name + const NextProtoTLS + const Version + var DebugGoroutines = os.Getenv("DEBUG_HTTP2_GOROUTINES") == "1" + var ErrFrameTooLarge = errors.New("http2: frame too large") + 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 NewHostClient(c *config.ClientConfig) client.HostClient + func NewResponseWriter(conn network.Conn) (network.ExtWriter, error) + func Record(ti traceinfo.TraceInfo, event stats.Event, err error) + func WithRequestDoneObserver(ctx context.Context, observer func(<-chan struct{})) context.Context + type BaseEngine struct + Core suite.Core + func (b *BaseEngine) AcquireReqCtx() *app.RequestContext + func (b *BaseEngine) ReleaseReqCtx(ctx *app.RequestContext) + 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 HostClient struct + Addr string + IsTLS bool + func (hc *HostClient) CloseIdleConnections() + func (hc *HostClient) ConnectionCount() int + func (hc *HostClient) Do(ctx context.Context, req *protocol.Request, rsp *protocol.Response) error + func (hc *HostClient) Get(ctx context.Context, dst []byte, url string) (statusCode int, body []byte, err error) + func (hc *HostClient) SetDynamicConfig(dc *client.DynamicConfig) + func (hc *HostClient) ShouldRemove() bool + 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 Server struct + NewWriteScheduler func() WriteScheduler + func (s *Server) Serve(ctx context.Context, c network.Conn) error + type Setting struct + ID SettingID + Val uint32 + func (s Setting) String() string + func (s Setting) Valid() error + type SettingID uint16 + const SettingEnableConnectProtocol + 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 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