vintage_net v0.6.0 VintageNet.Persistence behaviour View Source

Customize the way VintageNet saves and loads configurations

Link to this section Summary

Callbacks

Clear out a previously saved configuration

Enumerate the interfaces that have saved configurations

Load the configuration of an interface

Save the configuration for the specified interface

Link to this section Functions

Link to this function

call(fun, args)

View Source
call(atom(), [any()]) :: any()

Link to this section Callbacks

Link to this callback

clear(ifname)

View Source
clear(ifname :: String.t()) :: :ok

Clear out a previously saved configuration

Link to this callback

enumerate()

View Source
enumerate() :: [String.t()]

Enumerate the interfaces that have saved configurations

This returns a list of interface names.

Link to this callback

load(ifname)

View Source
load(ifname :: String.t()) :: {:ok, map()} | {:error, reason :: any()}

Load the configuration of an interface

Link to this callback

save(ifname, config)

View Source
save(ifname :: String.t(), config :: map()) :: :ok | {:error, atom()}

Save the configuration for the specified interface