Aurinko.Config (Aurinko v0.2.1)

Copy Markdown View Source

Configuration management for Aurinko.

All options can be set in config.exs or passed per-request.

Options

  • :client_id (string, required) — Aurinko application client ID
  • :client_secret (string, required) — Aurinko application client secret
  • :base_url (string) — Base URL for the Aurinko API. Default: https://api.aurinko.io/v1
  • :timeout (pos_integer) — HTTP request timeout in milliseconds. Default: 30_000
  • :retry_attempts (non_neg_integer) — Number of retry attempts. Default: 3
  • :retry_delay (pos_integer) — Base retry delay in ms (exponential backoff). Default: 500
  • :pool_size (pos_integer) — HTTP connection pool size. Default: 10
  • :log_level (atom) — One of :debug, :info, :warning, :error, :none. Default: :info

Summary

Functions

Returns the configured base URL.

Loads and validates configuration from application env. Raises Aurinko.ConfigError if required keys are missing or invalid.

Merges runtime overrides on top of the base config.

Types

t()

@type t() :: %{
  client_id: String.t(),
  client_secret: String.t(),
  base_url: String.t(),
  timeout: pos_integer(),
  retry_attempts: non_neg_integer(),
  retry_delay: pos_integer(),
  pool_size: pos_integer(),
  log_level: :debug | :info | :warning | :error | :none
}

Functions

base_url()

@spec base_url() :: String.t()

Returns the configured base URL.

load!()

@spec load!() :: t()

Loads and validates configuration from application env. Raises Aurinko.ConfigError if required keys are missing or invalid.

merge(base, overrides)

@spec merge(
  t(),
  keyword()
) :: t()

Merges runtime overrides on top of the base config.