Tank.Nic (Tank v0.1.0)

Copy Markdown View Source

One network interface inside a pod's network namespace.

  • mode:macvlan (v1); :bridge / :ipvlan are modelled for later.
  • parent — the host uplink to attach to, or :auto to resolve it via Tank.Host.
  • ip{address, prefix} for a static address (v1), or :dhcp (later).
  • gateway — optional default-route next hop for this NIC.

Loopback is always raised by the runtime and is not listed here.

Summary

Functions

Build a validated NIC from a map or keyword list.

Like new/1 but raises ArgumentError on invalid input.

Types

ip()

@type ip() :: {String.t(), 0..32} | :dhcp

t()

@type t() :: %Tank.Nic{
  gateway: String.t() | nil,
  ip: ip(),
  mode: :macvlan | :bridge | :ipvlan,
  name: String.t(),
  parent: String.t() | :auto
}

Functions

new(attrs)

@spec new(map() | keyword()) :: {:ok, t()} | {:error, term()}

Build a validated NIC from a map or keyword list.

new!(attrs)

@spec new!(map() | keyword()) :: t()

Like new/1 but raises ArgumentError on invalid input.