Conduit v0.8.3 Conduit.Encoding.GZip View Source

Handles encoding a message body to and from gzip.

Link to this section Summary

Functions

Decodes the message body from gzip and sets the content encoding

Encodes the message body to gzip and sets the content encoding

Link to this section Functions

Decodes the message body from gzip and sets the content encoding.

Examples

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

Encodes the message body to gzip and sets the content encoding.

Examples

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