Recursive validation for replicated command safety.
Walks any Elixir term to ensure it contains no anonymous functions, PIDs, ports, or references — values that break deterministic serialization. Also enforces depth and size limits.
Summary
Functions
Validates a Concord key against the configured byte-size limit.
Walks a term recursively, rejecting non-serializable values.
Validates a transaction spec before replicated submission.
Functions
@spec validate_key(term()) :: :ok | {:error, :empty_key | :key_too_large | :invalid_key}
Validates a Concord key against the configured byte-size limit.
The default maximum is 4096 bytes and can be changed with
config :concord, kv: [max_key_bytes: bytes].
@spec validate_term(term(), non_neg_integer()) :: :ok | {:error, atom()}
Walks a term recursively, rejecting non-serializable values.
Returns :ok or {:error, reason}.
Validates a transaction spec before replicated submission.
Checks structural correctness, limit compliance, and recursive safety.