# `AtpClient.Config`
[🔗](https://github.com/jcschuster/AtpClient/blob/v0.1.7/lib/atp_client/config.ex#L1)

Resolves configuration for each backend by merging (in increasing precedence):

  1. Library defaults declared in `mix.exs` under the `:env` key.
  2. Application configuration under the `:atp_client` OTP app.
  3. Per-call options passed as a `Keyword.t()`.

## Example

In `config/config.exs`:

    config :atp_client, :starexec,
      base_url: "https://starexec.example.org/starexec",
      username: System.get_env("STAREXEC_USER"),
      password: System.get_env("STAREXEC_PASS")

    config :atp_client, :isabelle,
      host: "isabelle.example.org",
      port: 9999,
      password: System.get_env("ISABELLE_PASSWORD"),
      local_dir: "/shared/problems",
      isabelle_dir: "/shared/problems",
      session: "HOL"

Any setting may be overridden per call. For instance,

    AtpClient.Isabelle.query(theory, session: "Main")

forces the `Main` session for that single query regardless of what is set
in `config.exs`.

# `backend`

```elixir
@type backend() :: :sotptp | :starexec | :isabelle
```

# `fetch`

```elixir
@spec fetch(backend(), atom(), any(), keyword()) :: any()
```

Returns the value of `key` from the resolved settings for `backend`, falling
back to the given `default` if unset or set to `nil`.

# `fetch!`

```elixir
@spec fetch!(backend(), atom(), keyword()) :: any()
```

Returns the value of `key` from the resolved settings for `backend`, raising
a descriptive `ArgumentError` if unset or `nil`.

Use this for settings that have no sensible default (for example
`:base_url`, `:password`, `:local_dir`).

# `get`

```elixir
@spec get(
  backend(),
  keyword()
) :: keyword()
```

Returns the fully resolved settings for the given backend as a keyword list.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
