DNS.Message.Record.Data.Registry (DNS v0.5.0)

View Source

Registry 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

record_module()

@type record_module() :: module()

record_type()

@type record_type() :: non_neg_integer()

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

init_builtin_types()

@spec init_builtin_types() :: :ok

Initialize built-in record types.

list_types()

@spec list_types() :: [{record_type(), record_module()}]

Get all registered record types.

lookup(type)

@spec lookup(record_type()) :: {:ok, record_module()} | {:error, :not_found}

Look up a record type implementation.

register(type, module)

@spec register(record_type(), record_module()) :: :ok | {:error, term()}

Register a record type implementation.

registered?(type)

@spec registered?(record_type()) :: boolean()

Check if a type is registered.

start_link(opts \\ [])

@spec start_link(keyword()) :: GenServer.on_start()

Start the registry server.