hpack

package
v0.0.0-...-fe14df0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Decoder *Decoder
	Encoder *Encoder
}

Context manages both HPACK encoding and decoding. Is basically a wrapper.

func NewContext

func NewContext(encoderDynTabMaxSize uint32, decoderDynTabMaxSize uint32) *Context

NewContext creates a new hpack-context. It initializes a new dynamic table with a given max-size.

func (*Context) Decode

func (c *Context) Decode(bytes []byte) ([]*HeaderField, error)

Decode decodes a sequence of bytes from a header frame. Returns an array of HeaderFields

func (*Context) DecoderDynamicTable

func (c *Context) DecoderDynamicTable() []*HeaderField

DecoderDynamicTable returns a deep copy of the HeaderFields in the decoder's dynamic table

func (*Context) Encode

func (c *Context) Encode(hfs []*HeaderField) []byte

Encode encodes a set of headers

func (*Context) EncoderDynamicTable

func (c *Context) EncoderDynamicTable() []*HeaderField

EncoderDynamicTable returns a deep copy of the HeaderFields in the encoder's dynamic table

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

Decoder manages the decoding of headerfields

func NewDecoder

func NewDecoder(dynTabMaxSize uint32) *Decoder

NewDecoder creates a new decoder with given table size

func (*Decoder) Decode

func (d *Decoder) Decode(buf []byte) ([]*HeaderField, error)

Decode decodes a byte array of headers

type Encoder

type Encoder struct {
	// contains filtered or unexported fields
}

Encoder manages the encoding of headerfields

func NewEncoder

func NewEncoder(dynTabMaxSize uint32) *Encoder

NewEncoder creates a new encoder with given table size

func (*Encoder) EncodeField

func (e *Encoder) EncodeField(hf *HeaderField) []byte

EncodeField encodes a given headerfield and returns the sequence of encoded bytes

type HeaderField

type HeaderField struct {
	Name  string
	Value string
}

HeaderField contains the name and the value of a header

func (*HeaderField) String

func (hf *HeaderField) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL