TimeZoneInfo v0.4.0 TimeZoneInfo.Downloader behaviour View Source

The behaviour for downloaders.

Link to this section Summary

Types

HTTP headers.

The mode to download the data.

HTTP status code

Link to this section Types

Link to this type

download()

View Source
download() :: {:ok, mode(), {status_code(), binary()}}
Link to this type

headers()

View Source
headers() :: [{header_name :: String.t(), header_value :: String.t()}]

HTTP headers.

Link to this type

mode()

View Source
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.
Link to this type

opts()

View Source
opts() :: [headers: headers(), mode: mode()]
Link to this type

status_code()

View Source
status_code() :: non_neg_integer()

HTTP status code

Link to this section Callbacks

Link to this callback

download(uri, opts)

View Source
download(uri :: URI.t(), opts :: opts()) :: download() | {:error, term()}