Skip to main content

Module config

Module config 

Source
Expand description

The mesh declaration: whether this repository’s servers participate in discovery, and how. One typed object of the .ai/ layer (kind mesh, schema mesh/v1), parsed here and nowhere else. No declaration, or enabled: false, means the mesh is off and not one socket opens — the repository’s default posture (“nothing leaves the machine”) holds until a person commits the object that says otherwise.

use majordomus_cli::mesh::config::{MeshConfig, BroadcastMode};

// The defaults are the safe ones: multicast prepared, broadcast off, nobody trusted.
let minimal: MeshConfig = serde_json::from_value(serde_json::json!({
    "schema": "mesh/v1", "kind": "mesh-declaration", "id": "docs", "enabled": false
})).unwrap();
assert!(!minimal.enabled);
assert_eq!(minimal.broadcast.mode, BroadcastMode::Disabled);
assert!(minimal.trust.allow.is_empty());

Structs§

BroadcastConfig
Broadcast settings: the fallback’s mode, destinations and cadence; disabled unless a person declared otherwise.
CooperationConfig
Cooperation settings: whether this runtime links to the trusted runtimes of its repository, how often it proves it is alive, when a silent runtime counts as gone, and which endpoints to dial when discovery cannot find them.
MeshConfig
The whole declaration: the master switch and one section per mechanism. Unknown keys are refused, so a typo is an error and not a silently ignored wish.
MulticastConfig
Multicast settings: the group, the port, how far a datagram travels and how often this node announces.
RendezvousConfig
Rendezvous settings: other Majordomus servers to register with. Plain HTTP on a private network; there is no TLS in this executable, and the protocol assumes none — candidates verify end-to-end by signature, a poisoned rendezvous can withhold nodes but not invent them.
TrustConfig
Trust settings: the policy, and the public keys trusted regardless of it.

Enums§

BroadcastMode
Broadcast mode: off, automatic (the limited broadcast address), or explicit networks.

Constants§

DEFAULT_EXPIRY
The default seconds of silence before a runtime expires.
DEFAULT_GROUP
The default multicast group: an address in the IPv4 organization-local scope (239.0.0.0/8, RFC 2365), chosen once here.
DEFAULT_HEARTBEAT
The default seconds between cooperation heartbeats.
DEFAULT_INTERVAL
The default seconds between announcements.
DEFAULT_PORT
The default UDP port for multicast and broadcast datagrams.
KIND
The kind the declaration is discovered under.
SCHEMA_VERSION
The schema version this executable reads.