Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- class IsRPC r => GRPCInput r i where
- encodeInput :: r -> Compression -> i -> Builder
- decodeInput :: r -> Compression -> Decoder (Either String i)
- class IsRPC r => GRPCOutput r o where
- encodeOutput :: r -> Compression -> o -> Builder
- decodeOutput :: r -> Compression -> Decoder (Either String o)
- data Builder
- data Decoder a
- fromBuilder :: Builder -> ByteString
- fromDecoder :: Decoder (Either String a) -> Either String a
- data Compression = Compression {}
- newtype Encoding = Encoding {}
- newtype Decoding = Decoding {}
- grpcCompressionHV :: Compression -> HeaderValue
- uncompressed :: Compression
- gzip :: Compression
Encoding and decoding.
class IsRPC r => GRPCInput r i where Source #
encodeInput :: r -> Compression -> i -> Builder Source #
decodeInput :: r -> Compression -> Decoder (Either String i) Source #
class IsRPC r => GRPCOutput r o where Source #
encodeOutput :: r -> Compression -> o -> Builder Source #
decodeOutput :: r -> Compression -> Decoder (Either String o) Source #
Builder
s denote sequences of bytes.
They are Monoid
s where
mempty
is the zero-length sequence and
mappend
is concatenation, which runs in O(1).
fromBuilder :: Builder -> ByteString Source #
Finalizes a Builder.
Compression.
data Compression Source #
Opaque type for handling compression.
So far, only "pure" compression algorithms are supported.
TODO: suport IO-based compression implementations once we move from Builder
.
uncompressed :: Compression Source #
Do not compress.
gzip :: Compression Source #
Use gzip as compression.