Connection configuration validation and defaults.
Uses NimbleOptions to validate connection options passed to
InfluxElixir.ConnectionSupervisor and consumed by client
implementations.
Options
:host- InfluxDB host (e.g.,"localhost"or"us-east-1.influxdb.io") Required.:token- Authentication token. Required.:org- Organization name (default:""):database- Default database name (default:nil):databases- List of database names (informational; LocalClient pre-creates them, HTTP defaults:databaseto the first item if:databaseis not set). Default:[]:port- Port number (default:8086):scheme-:httpor:https(default::https):pool_size- Finch connection pool size (default:10)
Example
iex> InfluxElixir.Config.validate!(
...> host: "localhost",
...> token: "my-token",
...> scheme: :http,
...> port: 8086
...> )
Summary
Functions
Builds the base URL from validated config options.
Validates connection options and returns a normalized keyword list.
Validates connection options, raising on error.
Functions
Builds the base URL from validated config options.
Examples
iex> InfluxElixir.Config.base_url(scheme: :https, host: "example.com", port: 443)
"https://example.com:443"
@spec validate(keyword()) :: {:ok, keyword()} | {:error, NimbleOptions.ValidationError.t()}
Validates connection options and returns a normalized keyword list.
Returns {:ok, validated_opts} or {:error, %NimbleOptions.ValidationError{}}.
Examples
iex> {:ok, opts} = InfluxElixir.Config.validate(
...> host: "localhost",
...> token: "my-token"
...> )
iex> opts[:scheme]
:https
Validates connection options, raising on error.
Returns the validated keyword list or raises
NimbleOptions.ValidationError.
Examples
iex> opts = InfluxElixir.Config.validate!(
...> host: "localhost",
...> token: "my-token"
...> )
iex> opts[:port]
8086