MCPcopy Create free account
hub / github.com/imroc/req / FrameHeader

Struct FrameHeader

internal/http2/frame.go:154–174  ·  view source on GitHub ↗

A FrameHeader is the 9 byte header of all HTTP/2 frames. See https://httpwg.org/specs/rfc7540.html#FrameHeader

Source from the content-addressed store, hash-verified

152//
153// See https://httpwg.org/specs/rfc7540.html#FrameHeader
154type FrameHeader struct {
155 valid bool // caller can access []byte fields in the Frame
156
157 // Type is the 1 byte frame type. There are ten standard frame
158 // types, but extension frame types may be written by WriteRawFrame
159 // and will be returned by ReadFrame (as UnknownFrame).
160 Type FrameType
161
162 // Flags are the 1 byte of 8 potential bit flags per frame.
163 // They are specific to the frame type.
164 Flags Flags
165
166 // Length is the length of the frame, not including the 9 byte header.
167 // The maximum size is one byte less than 16MB (uint24), but only
168 // frames up to 16KB are allowed without peer agreement.
169 Length uint32
170
171 // StreamID is which stream this frame is for. Certain frames
172 // are not stream-specific, in which case this field is 0.
173 StreamID uint32
174}
175
176// Header returns h. It exists so FrameHeaders can be embedded in other
177// specific frame types and implement the Frame interface.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected