# `TimeZoneInfo.Downloader`
[🔗](https://github.com/hrzndhrn/time_zone_info/blob/main/lib/time_zone_info/downloader.ex#L1)

The behaviour for downloaders.

# `download`

```elixir
@type download() :: {:ok, mode(), {status_code(), binary()}}
```

# `headers`

```elixir
@type headers() :: [{header_name :: String.t(), header_value :: String.t()}]
```

HTTP headers.

# `mode`

```elixir
@type mode() :: :iana | :etf | :ws
```

The `mode` to download the data.

Possible modes:
- `:iana` downloads the data as a zipped tar archive in IANA format.
- `:etf` downloads the data as a compressed file in the `TimeZoneInfo`
  [External Term Format](http://erlang.org/doc/apps/erts/erl_ext_dist.html).
- `:ws` downloads the data from a web service.  In this mode, the
  configuration is sent to the server. The returned data is transformed
  according to the config on the server and comes in the same format as in the
  mode `:etf`.

# `opts`

```elixir
@type opts() :: [headers: headers(), mode: mode()]
```

# `status_code`

```elixir
@type status_code() :: non_neg_integer()
```

HTTP status code

# `download`

```elixir
@callback download(uri :: URI.t(), opts :: opts()) :: download() | {:error, term()}
```

---

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