Conduit v0.2.1 Conduit.Encoding.GZip
Handles encoding a message body to and from gzip.
Summary
Functions
Decodes the message body from gzip and sets the content encoding
Encodes the message body to gzip and sets the content encoding
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, 3, 171, 174, 5, 0, 67, 191, 166, 163, 2, 0, 0, 0>>)
iex> |> Conduit.Encoding.GZip.decode([])
iex> message.body
"{}"
iex> get_meta(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> message.body
<<31, 139, 8, 0, 0, 0, 0, 0, 0, 3, 171, 174, 5, 0, 67, 191, 166, 163, 2, 0, 0, 0>>
iex> get_meta(message, :content_encoding)
"gzip"