Quant.Explorer.Config (quant v0.1.0-alpha.1)
Centralized configuration management for Quant.Explorer.
This module provides a consistent interface for accessing configuration values from application environment, with sensible defaults and runtime value resolution (e.g., from system environment variables).
Summary
Functions
Gets an API key for a specific provider.
Gets all API keys as a map, resolving system environment variables.
Gets the caching configuration.
Gets the cache TTL (time-to-live) in milliseconds.
Gets a configuration value for the given key.
Gets the HTTP timeout in milliseconds.
Gets the log level for the application.
Gets the configuration for a specific provider.
Gets the rate limit for a specific provider (requests per minute). This is kept for backwards compatibility but new code should use the provider-specific configurations.
Gets the rate limiting configuration including backend and provider-specific settings.
Checks if telemetry is enabled.
Gets the user agent string for HTTP requests.
Validates that required configuration is present.
Functions
Gets an API key for a specific provider.
Handles runtime resolution of system environment variables.
@spec api_keys() :: map()
Gets all API keys as a map, resolving system environment variables.
@spec cache_config() :: keyword()
Gets the caching configuration.
@spec cache_ttl() :: pos_integer()
Gets the cache TTL (time-to-live) in milliseconds.
Gets a configuration value for the given key.
Supports nested keys using dot notation as atoms:
get(:api_keys)get([:rate_limits, :yahoo_finance])get(:http_timeout)
Returns the default value if the configuration is not found.
@spec http_timeout() :: pos_integer()
Gets the HTTP timeout in milliseconds.
@spec log_level() :: atom()
Gets the log level for the application.
Gets the configuration for a specific provider.
Returns a map with provider-specific configuration including rate limits, API keys, base URLs, etc.
@spec rate_limit(atom()) :: pos_integer()
Gets the rate limit for a specific provider (requests per minute). This is kept for backwards compatibility but new code should use the provider-specific configurations.
@spec rate_limiting_config() :: map()
Gets the rate limiting configuration including backend and provider-specific settings.
@spec telemetry_enabled?() :: boolean()
Checks if telemetry is enabled.
@spec user_agent() :: String.t()
Gets the user agent string for HTTP requests.
@spec validate_config() :: :ok | {:error, [atom()]}
Validates that required configuration is present.
Returns :ok if all required config is present, or
{:error, missing_keys} if anything is missing.