Gzip compression adapter using Erlang's :zlib module.
Provides gzip compression and decompression for request/response bodies.
Summary
Functions
Compresses binary data using gzip.
Returns the content encoding identifier for gzip.
Decompresses gzip-encoded binary data.
Functions
Compresses binary data using gzip.
Options
:level- Compression level (currently ignored, uses default)
Examples
iex> {:ok, compressed} = Pristine.Adapters.Compression.Gzip.compress("hello")
iex> is_binary(compressed)
true
Returns the content encoding identifier for gzip.
Examples
iex> Pristine.Adapters.Compression.Gzip.content_encoding()
"gzip"
Decompresses gzip-encoded binary data.
Options
Currently no options are supported.
Examples
iex> compressed = :zlib.gzip("hello")
iex> Pristine.Adapters.Compression.Gzip.decompress(compressed)
{:ok, "hello"}
iex> Pristine.Adapters.Compression.Gzip.decompress("invalid")
{:error, :invalid_gzip_data}