# `Lotus.Source.Resolver`
[🔗](https://github.com/elixir-lotus/lotus/blob/v1.0.0/lib/lotus/source/resolver.ex#L1)

Behaviour for resolving named data sources to adapters.

This is a **supported extension point**. The default implementation
(`Lotus.Source.Resolvers.Static`) reads from static `data_sources`
configuration, which is all most applications need. Alternative
implementations can resolve sources from registries, databases, or
external services — for example to register sources at runtime, to
manage per-tenant sources, or to change the set of available sources
without restarting the application.

Configure a custom resolver via the `:source_resolver` config key:

    config :lotus,
      source_resolver: MyApp.SourceResolver

See the [Custom Resolvers guide](custom-resolvers.html) for contracts,
minimal examples, and testing guidance.

# `default_source`

```elixir
@callback default_source() :: {String.t(), Lotus.Source.Adapter.t()}
```

# `get_source!`

```elixir
@callback get_source!(name :: String.t()) :: Lotus.Source.Adapter.t() | no_return()
```

# `list_source_names`

```elixir
@callback list_source_names() :: [String.t()]
```

# `list_sources`

```elixir
@callback list_sources() :: [Lotus.Source.Adapter.t()]
```

# `resolve`

```elixir
@callback resolve(
  source_opt :: nil | String.t() | module(),
  fallback :: nil | String.t() | module()
) :: {:ok, Lotus.Source.Adapter.t()} | {:error, term()}
```

---

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