erldns_handler behaviour (erldns v8.0.0-rc1)
View SourceThe module that handles the resolution of a single DNS question.
The meat of the resolution occurs in erldns_resolver:resolve/3
Configuration
{erldns, [
{handlers, [
{my_custom_handler_module, [?DNS_TYPE_A, ?DNS_TYPE_AAAA], 3}
]},
]}
The minimum supported version is 2
.
Version 2's handler signature is
handle(dns:message(), dns:labels(), dns:type(), [dns:rr()]) -> [dns:rr()]
Version 3's handler signature is
handle(dns:dname(), dns:type(), [dns:rr()], dns:message()) -> [dns:rr()].
Summary
Callbacks
Filter the given record set, returning replacement records.
Filter out records not related to the given handler
Map handler's record types to NSEC bit types.
Functions
Filter records through registered handlers.
Call all registered handlers.
Get all registered handlers along with the DNS types they handle and associated versions
Register a record handler with the default version of 1
Register a record handler with version
Start the handler registry process
Types
-opaque state()
Callbacks
Filter the given record set, returning replacement records.
-callback handle(dns:message(), dns:labels(), dns:type(), [dns:rr()]) -> [dns:rr()].
Filter out records not related to the given handler
Map handler's record types to NSEC bit types.
Functions
Filter records through registered handlers.
-spec call_handlers(dns:message(), dns:labels(), dns:type(), [dns:rr()]) -> [dns:rr()].
Call all registered handlers.
-spec get_versioned_handlers() -> [versioned_handler()].
Get all registered handlers along with the DNS types they handle and associated versions
Register a record handler with the default version of 1
Register a record handler with version
-spec start_link() -> gen_server:start_ret().
Start the handler registry process