-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | HTTP/2.0 library including HPACK -- -- HTTP/2.0 library including HPACK. Currently only HPACK 07 is -- supported. @package http2 @version 0.3.0 -- | HPACK: encoding and decoding a header set. module Network.HPACK -- | HPACK encoding, from HeaderSet to ByteStream. type HPACKEncoding = Context -> HeaderSet -> IO (Context, ByteStream) -- | HPACK decoding, from ByteStream to HeaderSet. type HPACKDecoding = Context -> ByteStream -> IO (Context, HeaderSet) -- | Converting HeaderSet for HTTP request to the low level format. encodeHeader :: EncodeStrategy -> HPACKEncoding -- | Converting the low level format for HTTP request to HeaderSet. -- DecodeError would be thrown. decodeHeader :: HPACKDecoding -- | Context for HPACK encoding/decoding. This is destructive! data Context -- | Creating a new Context. The first argument is the size of a -- header table. newContextForEncoding :: Size -> IO Context -- | Creating a new Context. The first argument is the size of a -- header table. newContextForDecoding :: Size -> IO Context -- | Compression algorithms for HPACK encoding. data CompressionAlgo -- | No compression Naive :: CompressionAlgo -- | Using the static table only Static :: CompressionAlgo -- | Using indices only Linear :: CompressionAlgo -- | Calculating difference Diff :: CompressionAlgo -- | Strategy for HPACK encoding. data EncodeStrategy EncodeStrategy :: CompressionAlgo -> Bool -> EncodeStrategy -- | Which compression algorithm is used. compressionAlgo :: EncodeStrategy -> CompressionAlgo -- | Whether or not to use Huffman encoding for strings. useHuffman :: EncodeStrategy -> Bool -- | Default EncodeStrategy. compressionAlgo is Linear -- and useHuffman is True. defaultEncodeStrategy :: EncodeStrategy -- | Errors for decoder. data DecodeError -- | Index is out of range IndexOverrun :: Index -> DecodeError -- | Eos appears in the middle of huffman string EosInTheMiddle :: DecodeError -- | Non-eos appears in the end of huffman string IllegalEos :: DecodeError -- | Eos of huffman string is more than 7 bits TooLongEos :: DecodeError -- | Encoded string has no length EmptyEncodedString :: DecodeError -- | Header block is empty EmptyBlock :: DecodeError -- | Header set. type HeaderSet = [Header] -- | Header. type Header = (HeaderName, HeaderValue) -- | Header name. type HeaderName = ByteString -- | Header value. type HeaderValue = ByteString -- | Byte stream in HTTP request/response. type ByteStream = ByteString -- | Size in bytes. type Size = Int -- | Index for table. type Index = Int