provisioning/schemas/platform/common/nats.ncl

46 lines
1.4 KiB
Text
Raw Normal View History

# NATS Message Broker Configuration Schema
# Common schema for NATS connection settings shared by all platform services
let NatsMode = std.contract.custom
(fun label value =>
if value == "embedded" || value == "server" then 'Ok value
else std.contract.blame_with_message "nats.mode must be 'embedded' or 'server'" label)
in
{
NatsConfig = {
# Connection mode: embedded (child process, solo) or server (external cluster)
mode | NatsMode | default = "embedded",
# NATS server URL (required when mode = "server")
url | String | default = "nats://127.0.0.1:4222",
# Port for the embedded nats-server process
port | Number | default = 4222,
# Enable JetStream persistence
jetstream | Bool | default = true,
# JetStream data directory (only for embedded mode)
jetstream_store_dir | String | optional,
# Authentication token (optional, solo mode typically omits)
auth_token | String | optional,
# TLS certificate path (optional, multi-user mode)
tls_cert | String | optional,
# TLS private key path (optional, multi-user mode)
tls_key | String | optional,
# Maximum reconnect attempts for client
max_reconnects | Number | default = 10,
# Wait between reconnect attempts in milliseconds
reconnect_wait_ms | Number | default = 2000,
# Subject prefix for all provisioning events
subject_prefix | String | default = "provisioning",
},
}