# `ExOss.LocalZipper`
[🔗](https://github.com/choice-form/ex_oss/blob/main/lib/ex_oss/local_zipper.ex#L1)

Local zip generation for S3-compatible storage services that lack
cloud-side zip capabilities.

This module downloads multiple files referenced by a zip index (produced
by `ExOss.Storage.mkzip_index_content/1`), zips them in memory using
`:zip.zip/3`, and returns the binary content. The resulting zip can then
be uploaded to the storage backend via a `ExOss.StorageTask`.

# `download_result`

```elixir
@type download_result() :: {:ok, binary()} | :error
```

# `zip_entry`

```elixir
@type zip_entry() :: {charlist(), binary()}
```

# `zip_list_result`

```elixir
@type zip_list_result() :: {:ok, [zip_entry()]} | :error
```

# `zip`

```elixir
@spec zip(binary()) :: {:ok, binary()} | {:error, :gen_file_error}
```

Downloads all files referenced in the index and returns the zip binary.

The `index_path` is the raw text returned by `ExOss.Storage.mkzip_index_content/1`.
Each line encodes a URL and an alias name, both Base64 url-safe encoded:

    /url/{base64(url)}/alias/{base64(alias_name)}

## Examples

    index = ExOss.Storage.mkzip_index_content([
      %{access_address: "https://s3.example.com/img1.jpg", alias_name: "img1.jpg"}
    ])

    {:ok, zip_binary} = ExOss.LocalZipper.zip(index)

Returns `{:ok, binary}` on success, or `{:error, :gen_file_error}` on failure.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
