NervesGate.Network.Adapter behaviour (nerves_gate v0.1.0)

Copy Markdown

Infrastructure boundary. Implementations may configure only LAN interfaces; USB provisioning must remain independent. Host implementations never touch workstation interfaces. Hardware writes run in the network server's bounded worker.

Summary

Callbacks

apply_config(map, term)

@callback apply_config(map(), term()) :: :ok | {:error, term()}

load(term)

@callback load(term()) :: {:ok, map()} | {:error, term()}

observations(term)

(optional)
@callback observations(term()) :: [{atom(), [String.t()]}]

restore(map, term)

@callback restore(map(), term()) :: :ok | {:error, term()}

save(map, term)

@callback save(map(), term()) :: :ok | {:error, term()}

snapshot(term)

@callback snapshot(term()) :: map() | nil

Functions

apply_config(arg, network)

load(arg)

restore(arg, network)

save(arg, network)

snapshot(arg)