| Safe Haskell | None |
|---|
Network.HPACK
Contents
Description
HPACK: encoding and decoding a header list.
- type HPACKEncoding = Context -> HeaderList -> IO (Context, ByteStream)
- type HPACKDecoding = Context -> ByteStream -> IO (Context, HeaderList)
- encodeHeader :: EncodeStrategy -> HPACKEncoding
- decodeHeader :: HPACKDecoding
- data Context
- newContextForEncoding :: Size -> IO Context
- newContextForDecoding :: Size -> IO Context
- data CompressionAlgo
- data EncodeStrategy = EncodeStrategy {}
- defaultEncodeStrategy :: EncodeStrategy
- data DecodeError
- type HeaderList = [Header]
- type Header = (HeaderName, HeaderValue)
- type HeaderName = ByteString
- type HeaderValue = ByteString
- type ByteStream = ByteString
- type Size = Int
- type Index = Int
Encoding and decoding
type HPACKEncoding = Context -> HeaderList -> IO (Context, ByteStream)Source
HPACK encoding, from HeaderList to ByteStream.
type HPACKDecoding = Context -> ByteStream -> IO (Context, HeaderList)Source
HPACK decoding, from ByteStream to HeaderList.
encodeHeader :: EncodeStrategy -> HPACKEncodingSource
Converting HeaderList for HTTP request to the low level format.
decodeHeader :: HPACKDecodingSource
Converting the low level format for HTTP request to HeaderList.
DecodeError would be thrown.
Contenxt
newContextForEncoding :: Size -> IO ContextSource
Creating a new Context.
The first argument is the size of a header table.
newContextForDecoding :: Size -> IO ContextSource
Creating a new Context.
The first argument is the size of a header table.
Strategy for encoding
data CompressionAlgo Source
Compression algorithms for HPACK encoding.
data EncodeStrategy Source
Strategy for HPACK encoding.
Constructors
| EncodeStrategy | |
Fields
| |
defaultEncodeStrategy :: EncodeStrategySource
Default EncodeStrategy. compressionAlgo is Linear and useHuffman is True.
Errors for decoding
data DecodeError Source
Errors for decoder.
Constructors
| 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 = ByteStringSource
Header name.
type HeaderValue = ByteStringSource
Header value.
Basic types
type ByteStream = ByteStringSource
Byte stream in HTTP request/response.