DNS.Message.Record.Data.Registry (DNS v0.5.0)
View SourceRegistry for DNS record type implementations.
This module provides a centralized registry for DNS record type implementations, allowing runtime extensibility and eliminating hardcoded type dispatch patterns.
Summary
Functions
Returns a specification to start this module under a supervisor.
Initialize built-in record types.
Get all registered record types.
Look up a record type implementation.
Register a record type implementation.
Check if a type is registered.
Start the registry server.
Types
@type record_module() :: module()
@type record_type() :: non_neg_integer()
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec init_builtin_types() :: :ok
Initialize built-in record types.
@spec list_types() :: [{record_type(), record_module()}]
Get all registered record types.
@spec lookup(record_type()) :: {:ok, record_module()} | {:error, :not_found}
Look up a record type implementation.
@spec register(record_type(), record_module()) :: :ok | {:error, term()}
Register a record type implementation.
@spec registered?(record_type()) :: boolean()
Check if a type is registered.
@spec start_link(keyword()) :: GenServer.on_start()
Start the registry server.