type

Config

Runtime-only MongoDB connection behavior.

Fields

PropertyTypeDescription
DatabaseURLstringCredential-bearing URL selecting the application database.
AllowInsecureTransportboolAllow an insecure local development connection; keep false in production.
ApplicationNamestringClient application name; defaults to ridu.
ConnectTimeouttime.DurationConnection bound; zero selects the Ridu default.
ServerSelectionTimeouttime.DurationPrimary-selection bound; zero selects the Ridu default.
MaxConnectionIdleTimetime.DurationPooled idle-time bound; zero selects the Ridu default.
MaxPoolSizeuint64Maximum pool size; zero selects ten.
MinPoolSizeuint64Minimum pool size; cannot exceed MaxPoolSize.

How it works

DatabaseURL never belongs in manifests, artifacts, generated contracts, or diagnostics. Negative durations and invalid pool bounds are rejected.

Full signature

type Config struct { DatabaseURL string // AllowInsecureTransport permits plaintext or certificate verification // bypasses to a remote host for an explicitly selected development // fixture. Loopback and Unix-socket databases never need it. AllowInsecureTransport bool ApplicationName string ConnectTimeout time.Duration ServerSelectionTimeout time.Duration MaxConnectionIdleTime time.Duration MaxPoolSize uint64 MinPoolSize uint64 }

Source adapters/mongodb/mongodb.go:37