Search documentation of macula

# macula_uri (macula v4.4.9)

View Source

Macula URI parsing and construction. Format: macula://realm/node_id Example: macula://org.example.mesh/0123456789abcdef...

# Summary

## Types

node_id/0
realm/0
uri/0

## Functions

equals(Uri1, Uri2)

Check if two URIs are equal.

get_node_id(Uri)

Extract node ID from URI.

get_realm(Uri)

Extract realm from URI.

is_valid(Uri)

Check if URI is valid.

new(Realm, NodeId)

Construct Macula URI from realm and node ID.

parse(Uri)

Parse Macula URI to extract realm and node ID.

# Types

# node_id/0

    -type node_id() :: binary().

# realm/0

    -type realm() :: binary().

# uri/0

    -type uri() :: binary().

# Functions

# equals(Uri1, Uri2)

    -spec equals(uri(), uri()) -> boolean().

Check if two URIs are equal.

# get_node_id(Uri)

    -spec get_node_id(uri()) -> {ok, node_id()} | {error, invalid_uri}.

Extract node ID from URI.

# get_realm(Uri)

    -spec get_realm(uri()) -> {ok, realm()} | {error, invalid_uri}.

Extract realm from URI.

# is_valid(Uri)

    -spec is_valid(uri()) -> boolean().

Check if URI is valid.

# new(Realm, NodeId)

    -spec new(realm(), node_id()) -> uri().

Construct Macula URI from realm and node ID.

# parse(Uri)

    -spec parse(uri()) -> {ok, realm(), node_id()} | {error, invalid_uri}.

Parse Macula URI to extract realm and node ID.