Validated configuration shared by all mesh strategies.
Built once at strategy startup from the libcluster topology config. Invalid
configuration — a missing key, a value of the wrong shape, or a key the
strategy does not support — raises ArgumentError immediately with a
descriptive message instead of failing silently at poll time.
Cluster members are selected either by hostname prefixes (hostnames, used
by the named meshes: Tailscale, ZTL, NetBird) or by an IPv4 CIDR (cidr,
used by plain WireGuard, which has no hostnames). The strategy decides
which selector it requires.
iex> LibclusterMesh.Config.new!([node_basename: "myapp", hostnames: ["myapp-"]], "tailscale")
%LibclusterMesh.Config{
node_basename: "myapp",
hostnames: ["myapp-"],
cli: "tailscale",
socket: nil,
interface: nil,
cidr: nil,
handshake_max_age: 180,
runner: LibclusterMesh.Runner.SystemCmd,
polling_interval: 5000,
cmd_timeout: 10000
}
Summary
Types
How a strategy picks cluster members out of the mesh: by hostname prefix, or by IPv4 CIDR on meshes that have no hostnames.
Types
selector— member selection mode (default:hostnames)socket— whether the strategy's daemon takes asocketpath
@type selector() :: :hostnames | :cidr
How a strategy picks cluster members out of the mesh: by hostname prefix, or by IPv4 CIDR on meshes that have no hostnames.
@type t() :: %LibclusterMesh.Config{ cidr: LibclusterMesh.CIDR.t() | nil, cli: String.t(), cmd_timeout: pos_integer(), handshake_max_age: pos_integer(), hostnames: [String.t()], interface: String.t() | nil, node_basename: String.t(), polling_interval: pos_integer(), runner: module(), socket: String.t() | nil }
node_basename— the part before@shared by every node in the clusterhostnames— mesh hostname prefixes that identify cluster memberscidr— parsed IPv4 CIDR selecting cluster members by mesh IPcli— path to the mesh CLI binary (strategy provides its default)socket— daemon socket path passed to the CLI (LOLIPOP ZTL only)interface— network interface name (WireGuard only)handshake_max_age— seconds since the last WireGuard handshake for a peer to still count as online (WireGuard only)runner— module implementingLibclusterMesh.Runnerpolling_interval— milliseconds between pollscmd_timeout— milliseconds to wait for the CLI before giving up
Functions
Builds a Config from a libcluster topology config keyword list.
default_cli is the strategy's CLI default (e.g. "tailscale"). The
selector decides which member-selection keys are required and which are
refused: :hostnames requires a non-empty hostnames list, :cidr
requires a valid cidr string and an interface name.
Raises ArgumentError when a required key is missing or any value has the
wrong shape.