# `Tank.Host`
[🔗](https://github.com/oshlabs/tank/blob/v0.2.0/lib/tank/host.ex#L1)

The host-config seam: how Tank reads the *host's* network facts without owning
them — the uplink a macvlan attaches to, and the DNS servers a container
inherits.

Tank must share these without dragging in any host-networking dependency, so
`Tank.Host` is a **behaviour**: an adapter
contract. The adapter is chosen by config and reached through this module's
facade — callers say `Tank.Host.uplink()` and never name the adapter:

    config :tank, host: Tank.Host.Static   # the default

Adapters:

  * `Tank.Host.Static` — shipped here, the v1 default: uplink + DNS straight
    from config. Runs anywhere.
  * A **consumer-provided adapter** — lives in the consumer, never in Tank's
    deps: reads the host's own network manager. *(later)*
  * `Tank.Host.Linx` — auto-detect uplink + DNS from rtnetlink and
    `/etc/resolv.conf`; a zero-config default. *(later)*

The contract is intentionally just what Tank core consumes today: the uplink
(resolving a NIC's `parent: :auto`) and the DNS list (the pod's
`/etc/resolv.conf` when it declares no `dns:`). It will grow host IP facts and
change-notifications when an adapter that has them needs them.

# `dns`

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

The host's DNS servers, as address strings (may be empty).

# `uplink`

```elixir
@callback uplink() :: {:ok, String.t()} | {:error, term()}
```

The uplink interface name a macvlan should attach to (`parent: :auto`).

# `adapter`

```elixir
@spec adapter() :: module()
```

The configured host adapter module (default `Tank.Host.Static`).

# `dns`

```elixir
@spec dns() :: [String.t()]
```

The host DNS servers via the configured adapter.

# `uplink`

```elixir
@spec uplink() :: {:ok, String.t()} | {:error, term()}
```

Resolve the host uplink via the configured adapter.

---

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