Consolidated validation for all Quiver configuration.
Summary
Functions
Parses a pool configuration map into a specificity-sorted list of validated rules.
Finds the first matching rule's config for the given origin, or nil.
Validates pool and transport options against the unified schema, applying defaults.
Types
@type pool_opts() :: [ size: integer(), checkout_timeout: integer(), idle_timeout: integer(), ping_interval: integer(), protocol: :auto | :http1 | :http2, max_connections: integer(), connect_timeout: integer(), recv_timeout: integer(), buffer_size: integer(), verify: :verify_peer | :verify_none, cacerts: :default | [any()], alpn_advertised_protocols: [binary()], proxy: [ host: binary(), port: integer(), scheme: :http | :https, headers: any() ] ]
Functions
@spec parse_rules(map()) :: {:ok, [Quiver.Config.Rule.t()]} | {:error, Quiver.Error.InvalidPoolRule.t() | Quiver.Error.InvalidPoolOpts.t()}
Parses a pool configuration map into a specificity-sorted list of validated rules.
@spec resolve_config( [Quiver.Config.Rule.t()], {atom(), String.t(), :inet.port_number()} ) :: keyword() | nil
Finds the first matching rule's config for the given origin, or nil.
@spec validate_pool(pool_opts()) :: {:ok, pool_opts()} | {:error, Quiver.Error.InvalidPoolOpts.t()}
Validates pool and transport options against the unified schema, applying defaults.
:size(integer/0) - Number of connections in the pool. The default value is10.:checkout_timeout(integer/0) - Max wait time in ms to acquire a connection. The default value is5000.:idle_timeout(integer/0) - Time in ms before idle connections are closed. The default value is30000.:ping_interval(integer/0) - Interval in ms to check connection health. The default value is5000.:protocol(:auto|:http1|:http2) - HTTP protocol version. :auto detects via ALPN negotiation. The default value is:auto.:max_connections(integer/0) - Max HTTP/2 connections per origin. The default value is1.:connect_timeout(integer/0) - TCP/TLS connect timeout in ms. The default value is5000.:recv_timeout(integer/0) - Socket receive timeout in ms. The default value is15000.:buffer_size(integer/0) - Socket receive buffer size in bytes. The default value is8192.:verify(:verify_peer|:verify_none) - TLS certificate verification mode. The default value is:verify_peer.:cacerts(:default| list ofterm/0) - CA certificates. :default uses OS store. The default value is:default.:alpn_advertised_protocols(list ofString.t/0) - ALPN protocols to advertise during TLS. The default value is[].:proxy(keyword/0)