Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DecodeFunc ¶ added in v0.6.0
type DecodeFunc func() (HeaderField, error)
DecodeFunc is a function that decodes the next header field from a header block. It should be called repeatedly until it returns io.EOF. It returns io.EOF when all header fields have been decoded. Any error other than io.EOF indicates a decoding error.
type Decoder ¶
type Decoder struct{}
A Decoder decodes QPACK header blocks. A Decoder can be reused to decode multiple header blocks on different streams on the same connection (e.g., headers then trailers). This will be useful when dynamic table support is added.
func (*Decoder) Decode ¶ added in v0.6.0
func (d *Decoder) Decode(p []byte) DecodeFunc
Decode returns a function that decodes header fields from the given header block. It does not copy the slice; the caller must ensure it remains valid during decoding.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
An Encoder performs QPACK encoding.
func NewEncoder ¶
NewEncoder returns a new Encoder which performs QPACK encoding. An encoded data is written to w.
func (*Encoder) Close ¶
Close declares that the encoding is complete and resets the Encoder to be reused again for a new header block.
func (*Encoder) WriteField ¶
func (e *Encoder) WriteField(f HeaderField) error
WriteField encodes f into a single Write to e's underlying Writer. This function may also produce bytes for the Header Block Prefix if necessary. If produced, it is done before encoding f.
type HeaderField ¶
A HeaderField is a name-value pair. Both the name and value are treated as opaque sequences of octets.
func (HeaderField) IsPseudo ¶
func (hf HeaderField) IsPseudo() bool
IsPseudo reports whether the header field is an HTTP3 pseudo header. That is, it reports whether it starts with a colon. It is not otherwise guaranteed to be a valid pseudo header field, though.