http2-grpc-types-0.2.0.0: Types for gRPC over HTTP2 common for client and servers.

Safe HaskellNone
LanguageHaskell2010

Network.GRPC.HTTP2.Encoding

Contents

Description

Module for GRPC binary encoding/decoding from and to binary messages.

So far, only "pure" compression algorithms are supported as we rely on Decoder (resp. Builder) which run with no interleaved side-effects.

Synopsis

Decoding.

decoder :: Message a => Compression -> Decoder (Either String a) Source #

Decoder for gRPC/HTTP2-encoded Protobuf messages.

fromDecoder :: Decoder (Either String a) -> Either String a Source #

Tries finalizing a Decoder.

Encoding.

encode :: Message m => Compression -> m -> Builder Source #

Encodes as binary using gRPC/HTTP2 framing.

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.

newtype Encoding Source #

Compression for Encoding.

newtype Decoding Source #

Compression for Decoding.

uncompressed :: Compression Source #

Do not compress.

gzip :: Compression Source #

Use gzip as compression.