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

Safe HaskellSafe
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

Encoding and decoding.

class IsRPC r => GRPCInput r i where Source #

class IsRPC r => GRPCOutput r o where Source #

data Builder #

Builders denote sequences of bytes. They are Monoids where mempty is the zero-length sequence and mappend is concatenation, which runs in O(1).

data Decoder a #

A decoder procuced by running a Get monad.

fromBuilder :: Builder -> ByteString Source #

Finalizes a Builder.

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

Tries finalizing a Decoder.

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.