evoq_type_provider (evoq v1.14.1)

View Source

Type provider for event type to module mapping.

Maintains mappings between: - Event types (binary strings) and event modules - Event types and their upcasters

This enables: - Dynamic event deserialization - Schema evolution through upcasters - Type-safe event handling

Summary

Functions

Get all registered event types.

Get the module for an event type.

Get the upcaster for an event type.

Register an event type to module mapping.

Register an upcaster for an event type.

Start the type provider.

Functions

get_all_types()

-spec get_all_types() -> [binary()].

Get all registered event types.

get_module(EventType)

-spec get_module(binary()) -> {ok, atom()} | {error, not_found}.

Get the module for an event type.

get_upcaster(EventType)

-spec get_upcaster(binary()) -> {ok, atom()} | {error, not_found}.

Get the upcaster for an event type.

register_event(EventType, Module)

-spec register_event(binary(), atom()) -> ok.

Register an event type to module mapping.

register_upcaster(EventType, UpcasterModule)

-spec register_upcaster(binary(), atom()) -> ok.

Register an upcaster for an event type.

start_link()

-spec start_link() -> {ok, pid()} | {error, term()}.

Start the type provider.