ExESDBGater.Config (ex_esdb_gater v0.8.0)
Configuration validation and normalization for ExESDBGater.
This module provides standardized configuration handling with proper validation, error handling, and normalization to ensure consistent behavior across the system.
Summary
Functions
Gets the cluster mode configuration.
Gets the connection retry interval configuration.
Gets the health check interval configuration.
Gets the maximum connections configuration.
Gets the pool size configuration.
Gets the port configuration.
Checks if libcluster should be used for node discovery.
Validates and normalizes configuration for ExESDBGater.
Validates libcluster topology configuration.
Types
Functions
Gets the cluster mode configuration.
@spec connection_retry_interval(config()) :: pos_integer()
Gets the connection retry interval configuration.
@spec health_check_interval(config()) :: pos_integer()
Gets the health check interval configuration.
@spec max_connections(config()) :: pos_integer()
Gets the maximum connections configuration.
@spec pool_size(config()) :: pos_integer()
Gets the pool size configuration.
@spec port(config()) :: non_neg_integer()
Gets the port configuration.
Checks if libcluster should be used for node discovery.
@spec validate(config()) :: {:ok, gater_config()} | {:error, {atom(), term()}}
Validates and normalizes configuration for ExESDBGater.
Options
:cluster_mode
- Whether to run in cluster mode (default:false
):port
- Port to listen on for HTTP API (default:4001
):max_connections
- Maximum number of concurrent connections (default:1000
):pool_size
- Size of worker pools (default:10
):use_libcluster
- Whether to use libcluster for node discovery (default:true
):connection_retry_interval
- Interval between connection retries in ms (default:5000
):health_check_interval
- Interval for health checks in ms (default:30000
)
Examples
iex> ExESDBGater.Config.validate([port: 4001])
{:ok, %{port: 4001, cluster_mode: false, ...}}
Validates libcluster topology configuration.