Runtime configuration resolution for StarlingBank.
Configuration can be supplied in three ways, resolved in this order of precedence (highest first):
Options passed directly to a client call (
opts[:access_token], etc.)A named client struct built with
StarlingBank.Client.new/1Application environment:
config :starling_bank, access_token: {:system, "STARLING_ACCESS_TOKEN"}, environment: :sandbox, receive_timeout: 15_000, retry: [max_attempts: 3, base_delay_ms: 250]
Summary
Functions
Builds a StarlingBank.Config struct, resolving values from the given
opts, falling back to application environment.
Types
@type environment() :: :production | :sandbox
@type t() :: %StarlingBank.Config{ access_token: String.t() | nil, base_url: String.t(), connect_timeout: pos_integer(), environment: environment(), receive_timeout: pos_integer(), retry: keyword(), transport: module(), user_agent: String.t() }
Functions
@spec base_url_for(environment()) :: String.t()
Builds a StarlingBank.Config struct, resolving values from the given
opts, falling back to application environment.