CPub.HTTP.AdapterHelper behaviour (CPub v0.3.0) View Source

Configure Tesla.Client with default and customized adapter options.

Link to this section Summary

Link to this section Types

Specs

host() :: charlist() | :inet.ip_address()

Specs

proxy() :: {host(), pos_integer()} | {proxy_type(), host(), pos_integer()}

Specs

proxy_type() :: :socks4 | :socks5

Link to this section Functions

Specs

format_host(String.t()) :: charlist()

Specs

format_proxy(String.t() | tuple() | nil) :: proxy() | nil
Link to this function

maybe_add_proxy(opts, proxy)

View Source

Specs

maybe_add_proxy(
  keyword(),
  proxy() | nil
) :: keyword()
Link to this function

options(uri, opts \\ [])

View Source

Specs

options(
  URI.t(),
  keyword()
) :: keyword()

Merge default connection & adapter options with received ones.

Specs

parse_host(String.t() | atom() | charlist()) :: charlist() | :inet.ip_address()

Specs

parse_proxy(String.t() | tuple() | nil) ::
  {:ok, host(), pos_integer()}
  | {:ok, proxy_type(), host(), pos_integer()}
  | {:error, atom()}
  | nil

Link to this section Callbacks

Specs

options(
  keyword(),
  URI.t()
) :: keyword()