Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
A Decoder is the decoding context for incremental processing of header blocks.
func NewDecoder ¶
func NewDecoder(emitFunc func(f HeaderField)) *Decoder
NewDecoder returns a new decoder The emitFunc will be called for each valid field parsed, in the same goroutine as calls to Write, before Write returns.
func (*Decoder) Close ¶
Close declares that the decoding is complete and resets the Decoder to be reused again for a new header block. If there is any remaining data in the decoder's buffer, Close returns an error.
func (*Decoder) DecodeFull ¶
func (d *Decoder) DecodeFull(p []byte) ([]HeaderField, error)
DecodeFull decodes an entire block.
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.