Jido.Signal.Serialization.Config (Jido Signal v1.0.0)

View Source

Configuration 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

all()

@spec all() :: keyword()

Get all serialization configuration as a keyword list.

default_serializer()

@spec default_serializer() :: module()

Get the configured default serializer.

default_type_provider()

@spec default_type_provider() :: module()

Get the configured default type provider.

set_default_serializer(serializer)

@spec set_default_serializer(module()) :: :ok

Set the default serializer at runtime.

set_default_type_provider(type_provider)

@spec set_default_type_provider(module()) :: :ok

Set the default type provider at runtime.

validate()

@spec validate() :: :ok | {:error, [String.t()]}

Validate the current configuration.

validate_serializer(serializer)

@spec validate_serializer(module()) :: :ok | {:error, String.t()}

Validate that the configured serializer implements the Serializer behaviour.

validate_type_provider(type_provider)

@spec validate_type_provider(module()) :: :ok | {:error, String.t()}

Validate that the configured type provider implements the TypeProvider behaviour.