macula_names (macula v0.20.5)
View SourceShared naming utilities for hierarchical dot-separated names. Used by both pub/sub topics and RPC procedure names. Supports DNS-style reverse notation: org.domain.service.method
Summary
Functions
Get the local node ID. Returns the node ID stored in persistent_term, or generates one if not set. This is used for NAT detection to identify the local node.
Extract namespace (first segment).
Normalize name (lowercase, trim, remove double dots).
Count number of segments in name.
Validate name syntax with default options (no wildcards).
Validate name syntax with options. Valid names: - Non-empty - Segments separated by dots - Segments contain alphanumeric, underscore, hyphen - Optionally allow wildcards (* and #) for patterns - No leading or trailing dots - No double dots
Types
Functions
-spec local_node_id() -> binary().
Get the local node ID. Returns the node ID stored in persistent_term, or generates one if not set. This is used for NAT detection to identify the local node.
Extract namespace (first segment).
Normalize name (lowercase, trim, remove double dots).
-spec segment_count(name()) -> non_neg_integer().
Count number of segments in name.
-spec validate(name()) -> ok | {error, invalid_name}.
Validate name syntax with default options (no wildcards).
Validate name syntax with options. Valid names: - Non-empty - Segments separated by dots - Segments contain alphanumeric, underscore, hyphen - Optionally allow wildcards (* and #) for patterns - No leading or trailing dots - No double dots