Jido.Signal.Serialization.Config (Jido Signal v1.0.0)
View SourceConfiguration management for serialization settings.
This module provides functions to get and set default serialization configuration for the Jido application.
Configuration Options
The following configuration keys are supported under the :jido
application:
:default_serializer
- The default serializer module to use (default: JsonSerializer):default_type_provider
- The default type provider module to use (default: ModuleNameTypeProvider)
Example Configuration
# In your config.exs or runtime.exs
config :jido,
default_serializer: Jido.Signal.Serialization.ErlangTermSerializer,
default_type_provider: Jido.Signal.Serialization.ModuleNameTypeProvider
Runtime Configuration
You can also change the configuration at runtime:
Jido.Signal.Serialization.Config.set_default_serializer(MyCustomSerializer)
Jido.Signal.Serialization.Config.set_default_type_provider(MyCustomTypeProvider)
Summary
Functions
Get all serialization configuration as a keyword list.
Get the configured default serializer.
Get the configured default type provider.
Set the default serializer at runtime.
Set the default type provider at runtime.
Validate the current configuration.
Validate that the configured serializer implements the Serializer behaviour.
Validate that the configured type provider implements the TypeProvider behaviour.
Functions
@spec all() :: keyword()
Get all serialization configuration as a keyword list.
@spec default_serializer() :: module()
Get the configured default serializer.
@spec default_type_provider() :: module()
Get the configured default type provider.
@spec set_default_serializer(module()) :: :ok
Set the default serializer at runtime.
@spec set_default_type_provider(module()) :: :ok
Set the default type provider at runtime.
@spec validate() :: :ok | {:error, [String.t()]}
Validate the current configuration.
Validate that the configured serializer implements the Serializer behaviour.
Validate that the configured type provider implements the TypeProvider behaviour.