Search documentation of macula

# macula_rpc_names (macula v0.44.2)

View Source

Name validation and utilities for RPC procedures. Uses reverse DNS notation: org.domain.service.procedure

# Summary

## Types

name/0

## Functions

matches(Name, Pattern)

Check if name matches pattern. For now, only exact matching (no wildcards). Future: Could add wildcard patterns if needed.

namespace(Name)

Extract namespace (first segment).

normalize(Name)

Normalize name (lowercase, trim, remove double dots).

segment_count(Name)

Count number of segments in name.

validate(Name)

Validate RPC procedure name syntax. Valid names: - Non-empty - Segments separated by dots - Segments contain alphanumeric, underscore, hyphen - No leading or trailing dots - No double dots - No wildcards allowed (unlike topics)

# Types

# name/0

    -type name() :: binary().

# Functions

# matches(Name, Pattern)

    -spec matches(name(), name()) -> boolean().

Check if name matches pattern. For now, only exact matching (no wildcards). Future: Could add wildcard patterns if needed.

# namespace(Name)

    -spec namespace(name()) -> binary().

Extract namespace (first segment).

# normalize(Name)

    -spec normalize(name()) -> name().

Normalize name (lowercase, trim, remove double dots).

# segment_count(Name)

    -spec segment_count(name()) -> non_neg_integer().

Count number of segments in name.

# validate(Name)

    -spec validate(name()) -> ok | {error, invalid_name}.

Validate RPC procedure name syntax. Valid names: - Non-empty - Segments separated by dots - Segments contain alphanumeric, underscore, hyphen - No leading or trailing dots - No double dots - No wildcards allowed (unlike topics)