livery_grpc_compression (livery_grpc v0.1.0)
View SourcegRPC per-message compression.
Supports identity (no compression) and gzip. The active algorithm is
negotiated through the grpc-encoding (what this message used) and
grpc-accept-encoding (what the peer can decode) headers.
A frame's compressed flag (see livery_grpc_frame) says whether its
payload went through compress/2; identity always leaves the flag
clear.
Summary
Functions
The grpc-accept-encoding value advertising what we can decode.
Compress a payload. Returns {Compressed, Bytes}: Compressed is the
boolean to put in the frame flag. identity never marks the frame.
Decompress a payload given the frame's compressed flag and the message encoding. A clear flag means the payload is identity-coded regardless of the negotiated algorithm (per the gRPC spec, the flag wins per message).
Parse a grpc-encoding header value into an algorithm. An absent header
(undefined) or an unknown value falls back to identity.
Whether an algorithm atom is supported.
Types
Functions
-spec accept_header() -> binary().
The grpc-accept-encoding value advertising what we can decode.
Compress a payload. Returns {Compressed, Bytes}: Compressed is the
boolean to put in the frame flag. identity never marks the frame.
Decompress a payload given the frame's compressed flag and the message encoding. A clear flag means the payload is identity-coded regardless of the negotiated algorithm (per the gRPC spec, the flag wins per message).
A set flag with an identity encoding is malformed and raises
{grpc_compression, flag_set_for_identity}.
Parse a grpc-encoding header value into an algorithm. An absent header
(undefined) or an unknown value falls back to identity.
Whether an algorithm atom is supported.