Poodle.Config (poodle v1.0.0)
View SourceConfiguration management for the Poodle SDK.
Supports configuration via environment variables and application config.
Summary
Functions
Get the current configuration.
Get the current configuration, raising on error.
Get the maximum content size allowed.
Validate configuration.
Types
@type t() :: %Poodle.Config{ api_key: String.t(), base_url: String.t(), debug: boolean(), finch_name: atom(), timeout: pos_integer() }
Functions
Get the current configuration.
Configuration is resolved in the following order:
- Explicitly passed options
- Application configuration
- Environment variables
- Default values
Examples
iex> Poodle.Config.get()
{:ok, %Poodle.Config{...}}
iex> Poodle.Config.get(api_key: "custom_key")
{:ok, %Poodle.Config{api_key: "custom_key", ...}}
Get the current configuration, raising on error.
Examples
iex> Poodle.Config.get!()
%Poodle.Config{...}
@spec max_content_size() :: pos_integer()
Get the maximum content size allowed.
Validate configuration.
Examples
iex> config = %Poodle.Config{api_key: "key", base_url: "https://api.example.com"}
iex> Poodle.Config.validate(config)
:ok