Resolves client configuration with a fixed precedence:
per-call options override application config (config :ex_ntfy, ...),
which overrides library defaults.
Summary
Functions
The client option keys, for splitting client options out of mixed keyword
lists (as ExNtfy.Publisher does).
Merges opts over app_env over defaults and validates the result.
Types
Functions
@spec keys() :: [atom()]
The client option keys, for splitting client options out of mixed keyword
lists (as ExNtfy.Publisher does).
Merges opts over app_env over defaults and validates the result.
app_env defaults to Application.get_all_env(:ex_ntfy); unknown keys in it
are ignored (the app env may hold unrelated entries), while unknown keys in
opts raise NimbleOptions.ValidationError.
Examples
iex> ExNtfy.Config.resolve()[:base_url]
"https://ntfy.sh"
iex> ExNtfy.Config.resolve([], base_url: "https://cfg.example")[:base_url]
"https://cfg.example"
iex> ExNtfy.Config.resolve([base_url: "http://localhost:8080"],
...> base_url: "https://cfg.example"
...> )[:base_url]
"http://localhost:8080"