Conduit v0.12.10 Conduit.Encoding.GZip View Source

Handles encoding to and from gzip.

Link to this section Summary

Functions

Decodes the message body from gzip

Encodes the message body to gzip

Link to this section Functions

Decodes the message body from gzip.

Examples

iex> import Conduit.Message
iex> body = <<31, 139, 8, 0, 0, 0, 0, 0, 0, 3, 171, 174, 5, 0, 67, 191, 166, 163, 2, 0, 0, 0>>
iex> message =
iex>   %Conduit.Message{}
iex>   |> put_body(body)
iex>   |> Conduit.Encoding.GZip.decode([])
iex> message.body
"{}"

Encodes the message body to gzip.

Examples

iex> import Conduit.Message
iex> message =
iex>   %Conduit.Message{}
iex>   |> put_body("{}")
iex>   |> Conduit.Encoding.GZip.encode([])
iex> :zlib.gunzip(message.body)
"{}"