macula_stations (macula v11.4.0)

View Source

Parse the MACULA_STATIONS seed list into the pinned seeds a pool takes: comma-separated <node id>@<host>:<port> entries, the node id as 64 lowercase hexadecimal characters, the host a DNS name, an IPv4 address or an IPv6 address in brackets, the port 1 to 65535. A station becomes the seed the pool takes, pinned to its node id, with its host as given. A refusal names the entry's position and what is wrong with it, and carries neither the value, nor a node id, nor a host.

Summary

Functions

Parse a MACULA_STATIONS value. Up to 64 entries, each <node id>@<host>:<port>. Refusals name the entry's position: {entry, N, form | node_id | port | host_dns | host_ipv4 | host_ipv6}, or a duplicate across entries {repeated_node_id, N, FirstN} / {repeated_host_and_port, N, FirstN}, or {too_many, 64} past the cap, or empty. No refusal carries a node id, a host, or the value.

Types

seed/0

-type seed() :: #{host := binary(), port := inet:port_number(), expected_node_id := <<_:256>>}.

Functions

parse(Value)

-spec parse(binary()) -> {ok, [seed()]} | {error, term()}.

Parse a MACULA_STATIONS value. Up to 64 entries, each <node id>@<host>:<port>. Refusals name the entry's position: {entry, N, form | node_id | port | host_dns | host_ipv4 | host_ipv6}, or a duplicate across entries {repeated_node_id, N, FirstN} / {repeated_host_and_port, N, FirstN}, or {too_many, 64} past the cap, or empty. No refusal carries a node id, a host, or the value.