module Network.HPACK.Types (
HeaderName
, HeaderValue
, HeaderStuff
, Header
, HeaderList
, ByteStream
, Index
, CompressionAlgo(..)
, EncodeStrategy(..)
, defaultEncodeStrategy
, DecodeError(..)
) where
import Control.Exception as E
import Data.ByteString (ByteString)
import Data.Typeable
type HeaderName = ByteString
type HeaderValue = ByteString
type Header = (HeaderName, HeaderValue)
type HeaderList = [Header]
type HeaderStuff = ByteString
type ByteStream = ByteString
type Index = Int
data CompressionAlgo = Naive
| Static
| Linear
data EncodeStrategy = EncodeStrategy {
compressionAlgo :: CompressionAlgo
, useHuffman :: Bool
}
defaultEncodeStrategy :: EncodeStrategy
defaultEncodeStrategy = EncodeStrategy {
compressionAlgo = Linear
, useHuffman = True
}
data DecodeError = IndexOverrun Index
| EosInTheMiddle
| IllegalEos
| TooLongEos
| EmptyEncodedString
| EmptyBlock
deriving (Eq,Show,Typeable)
instance Exception DecodeError