# `Quiver.Config`
[🔗](https://github.com/edlontech/quiver/blob/main/lib/quiver/config.ex#L14)

Consolidated validation for all Quiver configuration.

# `pool_opts`

```elixir
@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()
  ]
]
```

# `parse_rules`

```elixir
@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.

# `resolve_config`

```elixir
@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.

# `validate_pool`

```elixir
@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` (`t:integer/0`) - Number of connections in the pool. The default value is `10`.

* `:checkout_timeout` (`t:integer/0`) - Max wait time in ms to acquire a connection. The default value is `5000`.

* `:idle_timeout` (`t:integer/0`) - Time in ms before idle connections are closed. The default value is `30000`.

* `:ping_interval` (`t:integer/0`) - Interval in ms to check connection health. The default value is `5000`.

* `:protocol` (`:auto` | `:http1` | `:http2`) - HTTP protocol version. :auto detects via ALPN negotiation. The default value is `:auto`.

* `:max_connections` (`t:integer/0`) - Max HTTP/2 connections per origin. The default value is `1`.

* `:connect_timeout` (`t:integer/0`) - TCP/TLS connect timeout in ms. The default value is `5000`.

* `:recv_timeout` (`t:integer/0`) - Socket receive timeout in ms. The default value is `15000`.

* `:buffer_size` (`t:integer/0`) - Socket receive buffer size in bytes. The default value is `8192`.

* `:verify` (`:verify_peer` | `:verify_none`) - TLS certificate verification mode. The default value is `:verify_peer`.

* `:cacerts` (`:default` | list of `t:term/0`) - CA certificates. :default uses OS store. The default value is `:default`.

* `:alpn_advertised_protocols` (list of `t:String.t/0`) - ALPN protocols to advertise during TLS. The default value is `[]`.

* `:proxy` (`t:keyword/0`)

---

*Consult [api-reference.md](api-reference.md) for complete listing*
