livery_grpc_status (livery_grpc v0.1.0)
View SourcegRPC status codes and status metadata.
The 17 canonical codes (0 OK through 16 UNAUTHENTICATED) as atoms,
with conversions to and from the integer used in the grpc-status
trailer/header. Also encodes and decodes the grpc-message value, which
uses gRPC's percent-encoding (only %x20-%x7E minus % pass through
literally; everything else is %-escaped).
Summary
Functions
The integer code for a status atom.
Decode a percent-encoded grpc-message value.
Percent-encode a UTF-8 message for the grpc-message header. Printable
ASCII except % passes through; every other byte becomes %XX.
Parse a grpc-status value into a status atom.
Whether the term is a known status atom.
The status atom for an integer code. Unknown integers map to unknown, so
a peer using a code we do not model still yields a usable value.
Render a status (atom or integer) as the grpc-status value.
Status trailers with no message.
Status trailers carrying a (percent-encoded) message.
Types
-type code() :: 0..16.
-type status() ::
ok | cancelled | unknown | invalid_argument | deadline_exceeded | not_found | already_exists |
permission_denied | resource_exhausted | failed_precondition | aborted | out_of_range |
unimplemented | internal | unavailable | data_loss | unauthenticated.
Functions
The integer code for a status atom.
Decode a percent-encoded grpc-message value.
Percent-encode a UTF-8 message for the grpc-message header. Printable
ASCII except % passes through; every other byte becomes %XX.
Parse a grpc-status value into a status atom.
Whether the term is a known status atom.
The status atom for an integer code. Unknown integers map to unknown, so
a peer using a code we do not model still yields a usable value.
Render a status (atom or integer) as the grpc-status value.
Status trailers with no message.
Status trailers carrying a (percent-encoded) message.