Safe Haskell | None |
---|---|
Language | Haskell2010 |
HPACK: encoding and decoding a header list.
- type HPACKEncoding = DynamicTable -> HeaderList -> IO (DynamicTable, ByteString)
- type HPACKDecoding = DynamicTable -> ByteString -> IO (DynamicTable, HeaderList)
- encodeHeader :: EncodeStrategy -> HPACKEncoding
- decodeHeader :: HPACKDecoding
- type HPACKEncodingBuilder = DynamicTable -> HeaderList -> IO (DynamicTable, Builder)
- encodeHeaderBuilder :: EncodeStrategy -> HPACKEncodingBuilder
- data DynamicTable
- defaultDynamicTableSize :: Int
- newDynamicTableForEncoding :: Size -> IO DynamicTable
- newDynamicTableForDecoding :: Size -> IO DynamicTable
- data CompressionAlgo
- data EncodeStrategy = EncodeStrategy {}
- defaultEncodeStrategy :: EncodeStrategy
- data DecodeError
- type HeaderList = [Header]
- type Header = (HeaderName, HeaderValue)
- type HeaderName = ByteString
- type HeaderValue = ByteString
- type Size = Int
- type Index = Int
Encoding and decoding
type HPACKEncoding = DynamicTable -> HeaderList -> IO (DynamicTable, ByteString) Source
HPACK encoding from HeaderList
to ByteString
.
type HPACKDecoding = DynamicTable -> ByteString -> IO (DynamicTable, HeaderList) Source
HPACK decoding from ByteString
to HeaderList
.
encodeHeader :: EncodeStrategy -> HPACKEncoding Source
Converting HeaderList
for HTTP header to the low level format.
decodeHeader :: HPACKDecoding Source
Converting the low level format for HTTP header to HeaderList
.
DecodeError
would be thrown.
Encoding with builders
type HPACKEncodingBuilder = DynamicTable -> HeaderList -> IO (DynamicTable, Builder) Source
HPACK encoding from HeaderList
to Builder
.
encodeHeaderBuilder :: EncodeStrategy -> HPACKEncodingBuilder Source
Converting HeaderList
for HTTP header to bytestring builder.
DynamicTable
data DynamicTable Source
Type for dynamic table.
defaultDynamicTableSize :: Int Source
Default dynamic table size. The value is 4,096 bytes: an array has 128 entries.
>>>
defaultDynamicTableSize
4096
newDynamicTableForEncoding :: Size -> IO DynamicTable Source
Creating DynamicTable
.
newDynamicTableForDecoding :: Size -> IO DynamicTable Source
Creating DynamicTable
.
Strategy for encoding
data CompressionAlgo Source
Compression algorithms for HPACK encoding.
data EncodeStrategy Source
Strategy for HPACK encoding.
EncodeStrategy | |
|
defaultEncodeStrategy :: EncodeStrategy Source
Default EncodeStrategy
.
>>>
defaultEncodeStrategy
EncodeStrategy {compressionAlgo = Linear, useHuffman = True}
Errors for decoding
data DecodeError Source
Errors for decoder.
IndexOverrun Index | Index is out of range |
EosInTheMiddle | Eos appears in the middle of huffman string |
IllegalEos | Non-eos appears in the end of huffman string |
TooLongEos | Eos of huffman string is more than 7 bits |
EmptyEncodedString | Encoded string has no length |
EmptyBlock | Header block is empty |
Headers
type HeaderList = [Header] Source
Header list.
type Header = (HeaderName, HeaderValue) Source
Header.
type HeaderName = ByteString Source
Header name.
type HeaderValue = ByteString Source
Header value.