Safe Haskell | None |
---|
HPACK: encoding and decoding a header set.
- type HPACKEncoding = Context -> HeaderSet -> IO (Context, ByteStream)
- type HPACKDecoding = Context -> ByteStream -> IO (Context, HeaderSet)
- encodeRequestHeader :: HPACKEncoding
- decodeRequestHeader :: HPACKDecoding
- encodeResponseHeader :: HPACKEncoding
- decodeResponseHeader :: HPACKDecoding
- data Context
- newContext :: Size -> IO Context
- data DecodeError
- type HeaderSet = [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 -> HeaderSet -> IO (Context, ByteStream)Source
HPACK encoding, from HeaderSet
to ByteStream
.
type HPACKDecoding = Context -> ByteStream -> IO (Context, HeaderSet)Source
HPACK decoding, from ByteStream
to HeaderSet
.
Request
encodeRequestHeader :: HPACKEncodingSource
Converting HeaderSet
for HTTP request to the low level format.
decodeRequestHeader :: HPACKDecodingSource
Converting the low level format for HTTP request to HeaderSet
.
DecodeError
would be thrown.
Response
encodeResponseHeader :: HPACKEncodingSource
Converting HeaderSet
for HTTP response to the low level format.
decodeResponseHeader :: HPACKDecodingSource
Converting the low level format for HTTP response to HeaderSet
.
DecodeError
would be thrown.
Contenxt
newContext :: Size -> IO ContextSource
Creating a new Context
.
The first argument is the size of a header table.
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 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.