Tay.Config (tay v1.3.2)

Copy Markdown View Source

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.

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. Durability and storage-session options belong to the Engine and explicit Storage APIs, not this foundation configuration.

Summary

Functions

Reads the current :tay application environment and validates it.

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

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

Types

error()

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

t()

@type t() :: %Tay.Config{
  data_dir: String.t() | nil,
  queues: [{atom(), pos_integer()}]
}

Functions

load()

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

Reads the current :tay application environment and validates it.

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

new(options)

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

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

validate_startup(config, environment \\ :dev)

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