# `Tay.Config`
[🔗](https://github.com/AndriiSydorenko1904/tay/blob/v1.6.1/lib/tay/config.ex#L1)

Loads and validates Tay's foundation configuration without storage I/O.

Supported options:

  * `:data_dir` — a nonblank UTF-8 path without NUL bytes, or `nil` when
    unconfigured. Relative paths are expanded against the current working
    directory when configuration is loaded. Expansion is lexical: it does
    not resolve symlinks, create directories, or verify permissions.
  * `:queues` — a keyword list of unique atom names and positive integer
    concurrency limits, defaulting to `[default: 10]`. `[]` is allowed.
  * `:durability` — default job durability, `:persistent` (the default) or
    `:volatile`.
  * `:journal` — global persistent-journal batching configuration.

This module has no default storage path. This repository supplies provisional
dev/test paths in `config/config.exs`; these are not production storage-location
semantics. An unconfigured path is accepted by development/test application
startup only. Production startup requires an explicitly configured path.

Unknown and duplicate options are rejected. Queue strings are not converted
to atoms. Storage-session durability (`:sync` or development-only `:write`)
remains an Engine/Storage option and is distinct from job durability.

# `error`

```elixir
@type error() :: {:invalid_config, atom(), String.t()}
```

# `t`

```elixir
@type t() :: %Tay.Config{
  data_dir: String.t() | nil,
  durability: :persistent | :volatile,
  journal: keyword(),
  queues: [{atom(), pos_integer()}]
}
```

# `load`

```elixir
@spec load() :: {:ok, t()} | {:error, error()}
```

Reads the current `:tay_core` application environment and validates it.

Values are read on each call, rather than captured at compile time.

# `new`

```elixir
@spec new(keyword()) :: {:ok, t()} | {:error, error()}
```

Validates options and normalizes a configured path without changing the
application environment or touching storage.

# `validate_startup`

Enforces the production storage-location requirement without filesystem I/O.

---

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