View Source TimeZoneInfo.Downloader behaviour (TimeZoneInfo v0.7.2)

The behaviour for downloaders.

Summary

Types

HTTP headers.

The mode to download the data.

HTTP status code

Types

@type download() :: {:ok, mode(), {status_code(), binary()}}
@type headers() :: [{header_name :: String.t(), header_value :: String.t()}]

HTTP headers.

@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.
  • :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.
@type opts() :: [headers: headers(), mode: mode()]
@type status_code() :: non_neg_integer()

HTTP status code

Callbacks

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