Skip to content

Module dev_name.erl

A device for resolving names to their corresponding values, through the use of a resolver interface.

Description

Each resolver is a message that can be given a key and returns an associated value. The device will attempt to match the key against each resolver in turn, and return the value of the first resolver that matches.

Function Index

execute_resolver/3*Execute a resolver with the given key and return its value.
info/1Configure the default key to proxy to the resolver/4 function.
load_and_execute_test/0*Test that we can resolve messages from a name loaded with the device.
match_resolver/3*Find the first resolver that matches the key and return its value.
message_lookup_device_resolver/1*
multiple_resolvers_test/0*
no_resolvers_test/0*
resolve/4*Resolve a name to its corresponding value.
single_resolver_test/0*

Function Details

execute_resolver/3 *

execute_resolver(Key, Resolver, Opts) -> any()

Execute a resolver with the given key and return its value.

info/1

info(X1) -> any()

Configure the default key to proxy to the resolver/4 function. Exclude the keys and set keys from being processed by this device, as these are needed to modify the base message itself.

load_and_execute_test/0 *

load_and_execute_test() -> any()

Test that we can resolve messages from a name loaded with the device.

match_resolver/3 *

match_resolver(Key, Resolvers, Opts) -> any()

Find the first resolver that matches the key and return its value.

message_lookup_device_resolver/1 *

message_lookup_device_resolver(Msg) -> any()

multiple_resolvers_test/0 *

multiple_resolvers_test() -> any()

no_resolvers_test/0 *

no_resolvers_test() -> any()

resolve/4 *

resolve(Key, X2, Req, Opts) -> any()

Resolve a name to its corresponding value. The name is given by the key called. For example, GET /~name@1.0/hello&load=false grants the value of hello. If the load key is set to true, the value is treated as a pointer and its contents is loaded from the cache. For example, GET /~name@1.0/reference yields the message at the path specified by the reference key.

single_resolver_test/0 *

single_resolver_test() -> any()