Skip to main content

Configuration Reference

This page summarizes the config structs currently exposed by the framework and the runtime defaults applied by built-in modules.

Minimal starter block:

[vef.app]
name = "my-app"
port = 8080

[vef.data_sources.primary]
type = "sqlite"

File Lookup Order

The internal config module searches for application.toml in this order:

  • ./configs
  • $VEF_CONFIG_PATH
  • .
  • ../configs

Common Environment Variables

Common environment keys include:

  • VEF_CONFIG_PATH
  • VEF_LOG_LEVEL
  • VEF_I18N_LANGUAGE

vef.app

FieldTypeMeaning
namestringapplication name; also feeds defaults such as JWT audience generation
portuint16HTTP server port
body_limitstringFiber body limit, for example 10mib; defaults to 32mib when omitted
trusted_proxies[]stringproxy IPs or CIDR ranges trusted to set X-Forwarded-For; empty means forwarded headers from untrusted clients are ignored

vef.api

FieldTypeMeaning
rate_limit.maxintdefault per-operation rate limit applied to operations that declare no OperationSpec.RateLimit of their own; default 100 (v0.38)
rate_limit.perioddurationwindow for the default rate limit; default 5m (v0.38)

The limit is keyed per operation × client (resource, version, action, client IP, principal ID) and counted per node. Per-endpoint OperationSpec.RateLimit overrides still win; see API.

vef.data_sources

vef.data_sources is a map keyed by data source name. The primary entry is required and powers the framework-wide orm.DB injection; other entries are registered into the data source registry under their map key.

Example:

[vef.data_sources.primary]
type = "sqlite"

[vef.data_sources.analytics]
type = "sqlite"
path = "./analytics.db"
FieldTypeMeaning
typepostgres | mysql | sqliteruntime-supported database kind; oracle and sqlserver constants exist but are not implemented yet
hoststringnetwork database host
portuint16network database port
userstringdatabase username
passwordstringdatabase password
databasestringdatabase name
schemastringschema name for drivers that support schemas
pathstringSQLite file path
enable_sql_guardboolenables the SQL guard for raw SQL surfaces
ssl_modedisable | require | verify-ca | verify-fullTLS posture for network database dialects; omitted means disable
ssl_root_certstringoptional PEM CA bundle path for verify-ca and verify-full; empty uses the host system pool

Runtime note:

  • the current runtime provider registry supports postgres, mysql, and sqlite. oracle and sqlserver are declared as DBKind constants for future use but have no runtime provider yet, so configuring them fails at startup with database.ErrUnsupportedDBKind.

vef.cors

FieldTypeMeaning
enabledboolenables the CORS middleware
allow_origins[]stringallowed origin list

vef.security

FieldTypeMeaning
secretstringhex-encoded JWT signing key. If unset, the framework generates an ephemeral per-process key and warns; tokens do not survive restart or work across nodes. If set to the public security.DefaultJWTSecret, startup warns to replace it in production.
token_expiresdurationrefresh-token lifetime; default 168h
refresh_not_beforedurationearliest time a refresh token may be used; default 15m, half of the fixed 30m access-token lifetime
login_rate_limitintlogin endpoint rate limit; default 6
refresh_rate_limitintrefresh endpoint rate limit; default 1
ip_whitelistsmap[string][]stringnamed source-IP whitelists (IP or CIDR entries) consumed by the built-in ip auth strategy; TOML keys are lowercased, and the no-arg api.IPAuth() targets the default key
lockout.*brute-force lockout on the login endpoint: enabled default true, max_failures default 10, window default 15m, lock_duration default 15m, strategy (lock | backoff) default lock, backoff_base default 1s, backoff_max default 15m, key (user | ip | user_ip) default user_ip
password_policy.*password strength rules; every field is opt-in (a zero value disables the rule): min_length, max_length, require_upper, require_lower, require_digit, require_symbol, min_char_classes, disallow_username, blocklist, history_depth (reuse prevention; requires an app-provided security.PasswordHistoryStore), max_age (expiry; requires an app-provided security.PasswordMetadataLoader)
token_typejwt_token | opaque_tokenlogin token mechanism; default jwt_token. Session control (concurrency limits, force-offline, renewal) is only available with opaque_token
session.*opaque-token session tuning, no effect under jwt_token: max_concurrent default 0 (unlimited; enforcement is best-effort under concurrent logins), on_exceed (reject | evict_oldest) default evict_oldest, idle_ttl default 30m, max_lifetime default 168h (7 days), sliding default true

Runtime note:

  • access tokens issued by the built-in JWT token generator expire after 30m; vef.security.token_expires controls refresh tokens, not access tokens
  • lockout is on by default (max_failures = 10); a trip returns security.ErrAccountLocked (HTTP 429) and guard-store errors fail open
  • history_depth > 0 composes a history validator into the password policy only when a security.PasswordHistoryStore is registered; max_age only takes effect when the app wires a security.PasswordMetadataLoader and security.NewExpiryPasswordChangeChecker

vef.redis

FieldTypeMeaning
enabledboolconstructs the Redis client when true; default false
hoststringRedis host
portuint16Redis port
userstringRedis username
passwordstringRedis password
databaseuint8Redis database number
networkstringtcp or unix

Runtime note:

  • the default vef.Run(...) boot graph includes the Redis module
  • the Redis client is constructed only when enabled = true; when enabled is false or omitted, the framework provides a nil *redis.Client and skips startup PING
  • when enabled, omitted host/port/network fields default to 127.0.0.1, 6379, and tcp

vef.storage

FieldTypeMeaning
providermemory | minio | filesystemstorage provider selection
auto_migrateboolruns storage DDL migration at startup
minio.endpointstringMinIO endpoint
minio.access_keystringMinIO access key
minio.secret_keystringMinIO secret key
minio.bucketstringbucket name
minio.regionstringregion
minio.use_sslboolwhether to use HTTPS
filesystem.rootstringfilesystem provider root directory
max_upload_sizeint64maximum single-object upload size, default 1 GiB
claim_ttldurationupload claim lifetime, default 24h
max_pending_claimsintmaximum simultaneous pending claims per principal, default 100
allow_public_uploadsboolallows clients to request public uploads; default false
sweep_intervaldurationexpired-claim sweep interval, default 5m
sweep_batch_sizeintmaximum expired claims processed per sweep, default 200
delete_worker_intervaldurationpending-delete worker polling interval, default 5m
delete_batch_sizeintrows leased by one delete-worker tick, default 100
delete_concurrencyintconcurrent object deletions per worker tick, default 8
delete_max_attemptsintretry budget before dead-lettering a delete row, default 12
delete_lease_windowdurationdelete-row lease visibility window, default 5m

Runtime note:

  • omitting provider selects in-memory storage and logs a warning; objects are lost on restart
  • vef.storage.auto_migrate = true runs the idempotent storage migration and checks sys_storage_upload_claim, sys_storage_upload_part, and sys_storage_pending_delete
  • filesystem.root defaults to ./storage
  • minio.bucket defaults to minio.bucket, then vef.app.name, then vef-app
  • upload-flow and delete-worker tunables have defaults in the framework; use the StorageConfig Effective... accessors when application code needs the resolved values

vef.monitor

FieldTypeMeaning
sample_intervaldurationinterval between samples; default 10s
sample_durationdurationsampling window duration; default 2s

excluded_mounts was removed in v0.38: the overview's disk summary now reports the root filesystem only, so mount-point exclusions no longer apply (the full mount inventory remains available in the disk detail query).

vef.mcp

FieldTypeMeaning
enabledboolenables the MCP server and /mcp endpoint
require_authboolsecure by default: unset or true requires Bearer auth; only explicit false allows anonymous access. In Go, MCPConfig.RequireAuth is *bool so the runtime can distinguish unset from false.

vef.approval

FieldTypeMeaning
auto_migrateboolruns approval DDL migration at startup when explicitly enabled; ApprovalConfig.ApplyDefaults() does not turn it on
timeout_scan_intervaldurationtimeout scanner cadence, default 1m
pre_warning_scan_intervaldurationpre-warning scanner cadence, default 5m
cleanup_scan_intervaldurationretention cleanup cadence, default 24h
delegation_max_depthintmaximum delegation-chain depth, default 10
form_snapshot_retentiondurationapv_form_snapshot retention, default 90 days
urge_record_retentiondurationapv_urge_record retention, default 30 days
cc_record_retentiondurationretention for read apv_cc_record rows, default 90 days
business_binding.consistencysynchronous | eventualbusiness-table projection mode; default synchronous (failure rolls the approval action back). eventual commits desired state and lets the worker converge (v0.38)
business_binding.scan_intervaldurationeventual projection worker cadence, default 10s (v0.38)
business_binding.batch_sizeintprojections claimed per scan, default 100 (v0.38)

Outbox-related fields moved to [vef.event.transports.outbox] in v0.21; see Event Bus.

vef.event

FieldTypeDefault / meaning
default_transportstringroute fallback, default memory
async_queue_sizeintWithAsync queue capacity, default 4096
async_workersintasync worker count, default 4
publish_timeoutdurationper-transport publish timeout, default 5s
transports.memory.*queue_size default 1024, full_policy default error, publish_timeout default unset/no timeout and only applies when full_policy = "block"
transports.outbox.*enabled, relay_interval default 10s, max_retries default 10, batch_size default 100, lease_multiplier default 4, min_lease default 15s, sink default memory, cleanup_interval default 1h, completed_ttl default 168h; cleanup fields belong to framework config, not event/transport/outbox.Config
transports.redis_stream.*enabled, stream_prefix default vef:events:, max_len_approx default 0 (no trimming), block_timeout default 5s, claim_idle default 60s, claim_interval default 30s, claim_batch_size default 64, reaper_concurrency default 4, handler_timeout default 30s, setup_timeout default 5s, consumer_id default prefix vef, start_id default 0 ("$" skips backlog for newly created groups), idle_group_retention default 0 (disables orphaned consumer-group reclamation), idle_group_sweep_interval default 10m
middleware.*boolmiddleware toggles: logging, tracing, tracing_strict, metrics, recover, inbox
inbox.*retention default 168h, processing_lease default 10m, cleanup_interval default 1h
routing[]{pattern, transports}routing rules, matched top-to-bottom with path.Match

Config Package API Reference

Top-Level Public Symbols

SymbolKindSignature or value
config.AppConfigTYPEgithub.com/coldsmirk/vef-framework-go/config.AppConfig
config.ApprovalConfigTYPEgithub.com/coldsmirk/vef-framework-go/config.ApprovalConfig
config.ConfigTYPEgithub.com/coldsmirk/vef-framework-go/config.Config
config.CORSConfigTYPEgithub.com/coldsmirk/vef-framework-go/config.CORSConfig
config.DBKindTYPEgithub.com/coldsmirk/vef-framework-go/config.DBKind
config.DataSourceConfigTYPEgithub.com/coldsmirk/vef-framework-go/config.DataSourceConfig
config.DataSourcesConfigTYPEgithub.com/coldsmirk/vef-framework-go/config.DataSourcesConfig
config.DefaultClaimTTLCONSTtime.Duration = 86400000000000
config.DefaultDeleteBatchSizeCONSTint = 100
config.DefaultDeleteConcurrencyCONSTint = 8
config.DefaultDeleteLeaseWindowCONSTtime.Duration = 300000000000
config.DefaultDeleteMaxAttemptsCONSTint = 12
config.DefaultDeleteWorkerIntervalCONSTtime.Duration = 300000000000
config.DefaultLockoutBackoffBaseCONSTtime.Duration = 1000000000
config.DefaultLockoutBackoffMaxCONSTtime.Duration = 900000000000
config.DefaultLockoutLockDurationCONSTtime.Duration = 900000000000
config.DefaultLockoutMaxFailuresCONSTint = 10
config.DefaultLockoutWindowCONSTtime.Duration = 900000000000
config.DefaultMaxPendingClaimsCONSTint = 100
config.DefaultMaxUploadSizeCONSTint64 = 1073741824
config.DefaultSessionIdleTTLCONSTtime.Duration = 1800000000000
config.DefaultSessionMaxLifetimeCONSTtime.Duration = 604800000000000
config.DefaultSweepBatchSizeCONSTint = 200
config.DefaultSweepIntervalCONSTtime.Duration = 300000000000
config.EnvConfigPathCONSTuntyped string = "VEF_CONFIG_PATH"
config.EnvI18NLanguageCONSTuntyped string = "VEF_I18N_LANGUAGE"
config.EnvPrefixCONSTuntyped string = "VEF"
config.EnvLogLevelCONSTuntyped string = "VEF_LOG_LEVEL"
config.ErrInboxRetentionTooShortVARerror
config.ErrInvalidLockoutKeyVARerror
config.ErrInvalidLockoutStrategyVARerror
config.ErrInvalidSessionOnExceedVARerror
config.ErrInvalidTokenTypeVARerror
config.EventConfigTYPEgithub.com/coldsmirk/vef-framework-go/config.EventConfig
config.EventInboxConfigTYPEgithub.com/coldsmirk/vef-framework-go/config.EventInboxConfig
config.EventMemoryTransportConfigTYPEgithub.com/coldsmirk/vef-framework-go/config.EventMemoryTransportConfig
config.EventMiddlewareConfigTYPEgithub.com/coldsmirk/vef-framework-go/config.EventMiddlewareConfig
config.EventOutboxTransportConfigTYPEgithub.com/coldsmirk/vef-framework-go/config.EventOutboxTransportConfig
config.EventRedisStreamTransportConfigTYPEgithub.com/coldsmirk/vef-framework-go/config.EventRedisStreamTransportConfig
config.EventRoutingRuleTYPEgithub.com/coldsmirk/vef-framework-go/config.EventRoutingRule
config.EventTransportsConfigTYPEgithub.com/coldsmirk/vef-framework-go/config.EventTransportsConfig
config.FilesystemConfigTYPEgithub.com/coldsmirk/vef-framework-go/config.FilesystemConfig
config.LockoutConfigTYPEgithub.com/coldsmirk/vef-framework-go/config.LockoutConfig
config.LockoutKeyTYPEgithub.com/coldsmirk/vef-framework-go/config.LockoutKey
config.LockoutKeyIPCONSTgithub.com/coldsmirk/vef-framework-go/config.LockoutKey = "ip"
config.LockoutKeyUserCONSTgithub.com/coldsmirk/vef-framework-go/config.LockoutKey = "user"
config.LockoutKeyUserIPCONSTgithub.com/coldsmirk/vef-framework-go/config.LockoutKey = "user_ip"
config.LockoutStrategyTYPEgithub.com/coldsmirk/vef-framework-go/config.LockoutStrategy
config.LockoutStrategyBackoffCONSTgithub.com/coldsmirk/vef-framework-go/config.LockoutStrategy = "backoff"
config.LockoutStrategyLockCONSTgithub.com/coldsmirk/vef-framework-go/config.LockoutStrategy = "lock"
config.MCPConfigTYPEgithub.com/coldsmirk/vef-framework-go/config.MCPConfig
config.MinIOConfigTYPEgithub.com/coldsmirk/vef-framework-go/config.MinIOConfig
config.MonitorConfigTYPEgithub.com/coldsmirk/vef-framework-go/config.MonitorConfig
config.MySQLCONSTgithub.com/coldsmirk/vef-framework-go/config.DBKind = "mysql"
config.OracleCONSTgithub.com/coldsmirk/vef-framework-go/config.DBKind = "oracle"
config.PasswordPolicyConfigTYPEgithub.com/coldsmirk/vef-framework-go/config.PasswordPolicyConfig
config.PostgresCONSTgithub.com/coldsmirk/vef-framework-go/config.DBKind = "postgres"
config.PrimaryDataSourceNameCONSTuntyped string = "primary"
config.RedisConfigTYPEgithub.com/coldsmirk/vef-framework-go/config.RedisConfig
config.SQLServerCONSTgithub.com/coldsmirk/vef-framework-go/config.DBKind = "sqlserver"
config.SQLiteCONSTgithub.com/coldsmirk/vef-framework-go/config.DBKind = "sqlite"
config.SecurityConfigTYPEgithub.com/coldsmirk/vef-framework-go/config.SecurityConfig
config.SSLDisableCONSTgithub.com/coldsmirk/vef-framework-go/config.SSLMode = "disable"
config.SSLModeTYPEgithub.com/coldsmirk/vef-framework-go/config.SSLMode
config.SSLRequireCONSTgithub.com/coldsmirk/vef-framework-go/config.SSLMode = "require"
config.SSLVerifyCACONSTgithub.com/coldsmirk/vef-framework-go/config.SSLMode = "verify-ca"
config.SSLVerifyFullCONSTgithub.com/coldsmirk/vef-framework-go/config.SSLMode = "verify-full"
config.SessionConfigTYPEgithub.com/coldsmirk/vef-framework-go/config.SessionConfig
config.SessionExceedEvictOldestCONSTgithub.com/coldsmirk/vef-framework-go/config.SessionExceedPolicy = "evict_oldest"
config.SessionExceedPolicyTYPEgithub.com/coldsmirk/vef-framework-go/config.SessionExceedPolicy
config.SessionExceedRejectCONSTgithub.com/coldsmirk/vef-framework-go/config.SessionExceedPolicy = "reject"
config.StorageConfigTYPEgithub.com/coldsmirk/vef-framework-go/config.StorageConfig
config.StorageFilesystemCONSTgithub.com/coldsmirk/vef-framework-go/config.StorageProvider = "filesystem"
config.StorageMemoryCONSTgithub.com/coldsmirk/vef-framework-go/config.StorageProvider = "memory"
config.StorageMinIOCONSTgithub.com/coldsmirk/vef-framework-go/config.StorageProvider = "minio"
config.StorageProviderTYPEgithub.com/coldsmirk/vef-framework-go/config.StorageProvider
config.TokenTypeTYPEgithub.com/coldsmirk/vef-framework-go/config.TokenType
config.TokenTypeJWTCONSTgithub.com/coldsmirk/vef-framework-go/config.TokenType = "jwt_token"
config.TokenTypeOpaqueCONSTgithub.com/coldsmirk/vef-framework-go/config.TokenType = "opaque_token"

Exported Fields

FieldSignature and config tag
config.AppConfig.Namestring [field_order=1 tag="config:\"name\""]
config.AppConfig.Portuint16 [field_order=2 tag="config:\"port\""]
config.AppConfig.BodyLimitstring [field_order=3 tag="config:\"body_limit\""]
config.AppConfig.TrustedProxies[]string [field_order=4 tag="config:\"trusted_proxies\""]
config.ApprovalConfig.AutoMigratebool [field_order=1 tag="config:\"auto_migrate\""]
config.ApprovalConfig.TimeoutScanIntervaltime.Duration [field_order=2 tag="config:\"timeout_scan_interval\""]
config.ApprovalConfig.PreWarningScanIntervaltime.Duration [field_order=3 tag="config:\"pre_warning_scan_interval\""]
config.ApprovalConfig.CleanupScanIntervaltime.Duration [field_order=4 tag="config:\"cleanup_scan_interval\""]
config.ApprovalConfig.DelegationMaxDepthint [field_order=5 tag="config:\"delegation_max_depth\""]
config.ApprovalConfig.FormSnapshotRetentiontime.Duration [field_order=6 tag="config:\"form_snapshot_retention\""]
config.ApprovalConfig.UrgeRecordRetentiontime.Duration [field_order=7 tag="config:\"urge_record_retention\""]
config.ApprovalConfig.CCRecordRetentiontime.Duration [field_order=8 tag="config:\"cc_record_retention\""]
config.CORSConfig.Enabledbool [field_order=1 tag="config:\"enabled\""]
config.CORSConfig.AllowOrigins[]string [field_order=2 tag="config:\"allow_origins\""]
config.DataSourceConfig.Kindgithub.com/coldsmirk/vef-framework-go/config.DBKind [field_order=1 tag="config:\"type\""]
config.DataSourceConfig.Hoststring [field_order=2 tag="config:\"host\""]
config.DataSourceConfig.Portuint16 [field_order=3 tag="config:\"port\""]
config.DataSourceConfig.Userstring [field_order=4 tag="config:\"user\""]
config.DataSourceConfig.Passwordstring [field_order=5 tag="config:\"password\""]
config.DataSourceConfig.Databasestring [field_order=6 tag="config:\"database\""]
config.DataSourceConfig.Schemastring [field_order=7 tag="config:\"schema\""]
config.DataSourceConfig.Pathstring [field_order=8 tag="config:\"path\""]
config.DataSourceConfig.EnableSQLGuardbool [field_order=9 tag="config:\"enable_sql_guard\""]
config.DataSourceConfig.SSLModegithub.com/coldsmirk/vef-framework-go/config.SSLMode [field_order=10 tag="config:\"ssl_mode\""]
config.DataSourceConfig.SSLRootCertstring [field_order=11 tag="config:\"ssl_root_cert\""]
config.DataSourcesConfig.Mapmap[string]github.com/coldsmirk/vef-framework-go/config.DataSourceConfig [field_order=1 tag=""]
config.EventConfig.DefaultTransportstring [field_order=1 tag="config:\"default_transport\""]
config.EventConfig.AsyncQueueSizeint [field_order=2 tag="config:\"async_queue_size\""]
config.EventConfig.AsyncWorkersint [field_order=3 tag="config:\"async_workers\""]
config.EventConfig.PublishTimeouttime.Duration [field_order=4 tag="config:\"publish_timeout\""]
config.EventConfig.Transportsgithub.com/coldsmirk/vef-framework-go/config.EventTransportsConfig [field_order=5 tag="config:\"transports\""]
config.EventConfig.Middlewaregithub.com/coldsmirk/vef-framework-go/config.EventMiddlewareConfig [field_order=6 tag="config:\"middleware\""]
config.EventConfig.Inboxgithub.com/coldsmirk/vef-framework-go/config.EventInboxConfig [field_order=7 tag="config:\"inbox\""]
config.EventConfig.Routing[]github.com/coldsmirk/vef-framework-go/config.EventRoutingRule [field_order=8 tag="config:\"routing\""]
config.EventInboxConfig.Retentiontime.Duration [field_order=1 tag="config:\"retention\""]
config.EventInboxConfig.ProcessingLeasetime.Duration [field_order=2 tag="config:\"processing_lease\""]
config.EventInboxConfig.CleanupIntervaltime.Duration [field_order=3 tag="config:\"cleanup_interval\""]
config.EventMemoryTransportConfig.QueueSizeint [field_order=1 tag="config:\"queue_size\""]
config.EventMemoryTransportConfig.FullPolicystring [field_order=2 tag="config:\"full_policy\""]
config.EventMemoryTransportConfig.PublishTimeouttime.Duration [field_order=3 tag="config:\"publish_timeout\""]
config.EventMiddlewareConfig.Loggingbool [field_order=1 tag="config:\"logging\""]
config.EventMiddlewareConfig.Tracingbool [field_order=2 tag="config:\"tracing\""]
config.EventMiddlewareConfig.TracingStrictbool [field_order=3 tag="config:\"tracing_strict\""]
config.EventMiddlewareConfig.Metricsbool [field_order=4 tag="config:\"metrics\""]
config.EventMiddlewareConfig.Recoverbool [field_order=5 tag="config:\"recover\""]
config.EventMiddlewareConfig.Inboxbool [field_order=6 tag="config:\"inbox\""]
config.EventOutboxTransportConfig.Enabledbool [field_order=1 tag="config:\"enabled\""]
config.EventOutboxTransportConfig.RelayIntervaltime.Duration [field_order=2 tag="config:\"relay_interval\""]
config.EventOutboxTransportConfig.MaxRetriesint [field_order=3 tag="config:\"max_retries\""]
config.EventOutboxTransportConfig.BatchSizeint [field_order=4 tag="config:\"batch_size\""]
config.EventOutboxTransportConfig.LeaseMultiplierint [field_order=5 tag="config:\"lease_multiplier\""]
config.EventOutboxTransportConfig.MinLeasetime.Duration [field_order=6 tag="config:\"min_lease\""]
config.EventOutboxTransportConfig.SinkNamestring [field_order=7 tag="config:\"sink\""]
config.EventOutboxTransportConfig.CleanupIntervaltime.Duration [field_order=8 tag="config:\"cleanup_interval\""]
config.EventOutboxTransportConfig.CompletedTTLtime.Duration [field_order=9 tag="config:\"completed_ttl\""]
config.EventRedisStreamTransportConfig.Enabledbool [field_order=1 tag="config:\"enabled\""]
config.EventRedisStreamTransportConfig.StreamPrefixstring [field_order=2 tag="config:\"stream_prefix\""]
config.EventRedisStreamTransportConfig.MaxLenApproxint64 [field_order=3 tag="config:\"max_len_approx\""]
config.EventRedisStreamTransportConfig.BlockTimeouttime.Duration [field_order=4 tag="config:\"block_timeout\""]
config.EventRedisStreamTransportConfig.ClaimIdletime.Duration [field_order=5 tag="config:\"claim_idle\""]
config.EventRedisStreamTransportConfig.ClaimIntervaltime.Duration [field_order=6 tag="config:\"claim_interval\""]
config.EventRedisStreamTransportConfig.ClaimBatchSizeint64 [field_order=7 tag="config:\"claim_batch_size\""]
config.EventRedisStreamTransportConfig.ReaperConcurrencyint [field_order=8 tag="config:\"reaper_concurrency\""]
config.EventRedisStreamTransportConfig.HandlerTimeouttime.Duration [field_order=9 tag="config:\"handler_timeout\""]
config.EventRedisStreamTransportConfig.SetupTimeouttime.Duration [field_order=10 tag="config:\"setup_timeout\""]
config.EventRedisStreamTransportConfig.ConsumerIDstring [field_order=11 tag="config:\"consumer_id\""]
config.EventRedisStreamTransportConfig.StartIDstring [field_order=12 tag="config:\"start_id\""]
config.EventRedisStreamTransportConfig.IdleGroupRetentiontime.Duration [field_order=13 tag="config:\"idle_group_retention\""]
config.EventRedisStreamTransportConfig.IdleGroupSweepIntervaltime.Duration [field_order=14 tag="config:\"idle_group_sweep_interval\""]
config.EventRoutingRule.Patternstring [field_order=1 tag="config:\"pattern\""]
config.EventRoutingRule.Transports[]string [field_order=2 tag="config:\"transports\""]
config.EventTransportsConfig.Memorygithub.com/coldsmirk/vef-framework-go/config.EventMemoryTransportConfig [field_order=1 tag="config:\"memory\""]
config.EventTransportsConfig.Outboxgithub.com/coldsmirk/vef-framework-go/config.EventOutboxTransportConfig [field_order=2 tag="config:\"outbox\""]
config.EventTransportsConfig.RedisStreamgithub.com/coldsmirk/vef-framework-go/config.EventRedisStreamTransportConfig [field_order=3 tag="config:\"redis_stream\""]
config.FilesystemConfig.Rootstring [field_order=1 tag="config:\"root\""]
config.LockoutConfig.Enabled*bool [field_order=1 tag="config:\"enabled\""]
config.LockoutConfig.MaxFailuresint [field_order=2 tag="config:\"max_failures\""]
config.LockoutConfig.Windowtime.Duration [field_order=3 tag="config:\"window\""]
config.LockoutConfig.LockDurationtime.Duration [field_order=4 tag="config:\"lock_duration\""]
config.LockoutConfig.Strategygithub.com/coldsmirk/vef-framework-go/config.LockoutStrategy [field_order=5 tag="config:\"strategy\""]
config.LockoutConfig.BackoffBasetime.Duration [field_order=6 tag="config:\"backoff_base\""]
config.LockoutConfig.BackoffMaxtime.Duration [field_order=7 tag="config:\"backoff_max\""]
config.LockoutConfig.Keygithub.com/coldsmirk/vef-framework-go/config.LockoutKey [field_order=8 tag="config:\"key\""]
config.MCPConfig.Enabledbool [field_order=1 tag="config:\"enabled\""]
config.MCPConfig.RequireAuth*bool [field_order=2 tag="config:\"require_auth\""]
config.MinIOConfig.Endpointstring [field_order=1 tag="config:\"endpoint\""]
config.MinIOConfig.AccessKeystring [field_order=2 tag="config:\"access_key\""]
config.MinIOConfig.SecretKeystring [field_order=3 tag="config:\"secret_key\""]
config.MinIOConfig.Bucketstring [field_order=4 tag="config:\"bucket\""]
config.MinIOConfig.Regionstring [field_order=5 tag="config:\"region\""]
config.MinIOConfig.UseSSLbool [field_order=6 tag="config:\"use_ssl\""]
config.MonitorConfig.SampleIntervaltime.Duration [field_order=1 tag="config:\"sample_interval\""]
config.MonitorConfig.SampleDurationtime.Duration [field_order=2 tag="config:\"sample_duration\""]
config.MonitorConfig.ExcludedMounts[]string [field_order=3 tag="config:\"excluded_mounts\""]
config.PasswordPolicyConfig.MinLengthint [field_order=1 tag="config:\"min_length\""]
config.PasswordPolicyConfig.MaxLengthint [field_order=2 tag="config:\"max_length\""]
config.PasswordPolicyConfig.RequireUpperbool [field_order=3 tag="config:\"require_upper\""]
config.PasswordPolicyConfig.RequireLowerbool [field_order=4 tag="config:\"require_lower\""]
config.PasswordPolicyConfig.RequireDigitbool [field_order=5 tag="config:\"require_digit\""]
config.PasswordPolicyConfig.RequireSymbolbool [field_order=6 tag="config:\"require_symbol\""]
config.PasswordPolicyConfig.MinCharClassesint [field_order=7 tag="config:\"min_char_classes\""]
config.PasswordPolicyConfig.DisallowUsernamebool [field_order=8 tag="config:\"disallow_username\""]
config.PasswordPolicyConfig.Blocklist[]string [field_order=9 tag="config:\"blocklist\""]
config.PasswordPolicyConfig.HistoryDepthint [field_order=10 tag="config:\"history_depth\""]
config.PasswordPolicyConfig.MaxAgetime.Duration [field_order=11 tag="config:\"max_age\""]
config.RedisConfig.Enabledbool [field_order=1 tag="config:\"enabled\""]
config.RedisConfig.Hoststring [field_order=2 tag="config:\"host\""]
config.RedisConfig.Portuint16 [field_order=3 tag="config:\"port\""]
config.RedisConfig.Userstring [field_order=4 tag="config:\"user\""]
config.RedisConfig.Passwordstring [field_order=5 tag="config:\"password\""]
config.RedisConfig.Databaseuint8 [field_order=6 tag="config:\"database\""]
config.RedisConfig.Networkstring [field_order=7 tag="config:\"network\""]
config.SecurityConfig.Secretstring [field_order=1 tag="config:\"secret\""]
config.SecurityConfig.TokenExpirestime.Duration [field_order=2 tag="config:\"token_expires\""]
config.SecurityConfig.RefreshNotBeforetime.Duration [field_order=3 tag="config:\"refresh_not_before\""]
config.SecurityConfig.LoginRateLimitint [field_order=4 tag="config:\"login_rate_limit\""]
config.SecurityConfig.RefreshRateLimitint [field_order=5 tag="config:\"refresh_rate_limit\""]
config.SecurityConfig.IPWhitelistsmap[string][]string [field_order=6 tag="config:\"ip_whitelists\""]
config.SecurityConfig.Lockoutgithub.com/coldsmirk/vef-framework-go/config.LockoutConfig [field_order=7 tag="config:\"lockout\""]
config.SecurityConfig.PasswordPolicygithub.com/coldsmirk/vef-framework-go/config.PasswordPolicyConfig [field_order=8 tag="config:\"password_policy\""]
config.SecurityConfig.TokenTypegithub.com/coldsmirk/vef-framework-go/config.TokenType [field_order=9 tag="config:\"token_type\""]
config.SecurityConfig.Sessiongithub.com/coldsmirk/vef-framework-go/config.SessionConfig [field_order=10 tag="config:\"session\""]
config.SessionConfig.MaxConcurrentint [field_order=1 tag="config:\"max_concurrent\""]
config.SessionConfig.OnExceedgithub.com/coldsmirk/vef-framework-go/config.SessionExceedPolicy [field_order=2 tag="config:\"on_exceed\""]
config.SessionConfig.IdleTTLtime.Duration [field_order=3 tag="config:\"idle_ttl\""]
config.SessionConfig.MaxLifetimetime.Duration [field_order=4 tag="config:\"max_lifetime\""]
config.SessionConfig.Sliding*bool [field_order=5 tag="config:\"sliding\""]
config.StorageConfig.Providergithub.com/coldsmirk/vef-framework-go/config.StorageProvider [field_order=1 tag="config:\"provider\""]
config.StorageConfig.AutoMigratebool [field_order=2 tag="config:\"auto_migrate\""]
config.StorageConfig.MinIOgithub.com/coldsmirk/vef-framework-go/config.MinIOConfig [field_order=3 tag="config:\"minio\""]
config.StorageConfig.Filesystemgithub.com/coldsmirk/vef-framework-go/config.FilesystemConfig [field_order=4 tag="config:\"filesystem\""]
config.StorageConfig.MaxUploadSizeint64 [field_order=5 tag="config:\"max_upload_size\""]
config.StorageConfig.ClaimTTLtime.Duration [field_order=6 tag="config:\"claim_ttl\""]
config.StorageConfig.MaxPendingClaimsint [field_order=7 tag="config:\"max_pending_claims\""]
config.StorageConfig.AllowPublicUploadsbool [field_order=8 tag="config:\"allow_public_uploads\""]
config.StorageConfig.SweepIntervaltime.Duration [field_order=9 tag="config:\"sweep_interval\""]
config.StorageConfig.SweepBatchSizeint [field_order=10 tag="config:\"sweep_batch_size\""]
config.StorageConfig.DeleteWorkerIntervaltime.Duration [field_order=11 tag="config:\"delete_worker_interval\""]
config.StorageConfig.DeleteBatchSizeint [field_order=12 tag="config:\"delete_batch_size\""]
config.StorageConfig.DeleteConcurrencyint [field_order=13 tag="config:\"delete_concurrency\""]
config.StorageConfig.DeleteMaxAttemptsint [field_order=14 tag="config:\"delete_max_attempts\""]
config.StorageConfig.DeleteLeaseWindowtime.Duration [field_order=15 tag="config:\"delete_lease_window\""]

Exported Methods

MethodSignature
config.ApprovalConfig.ApplyDefaultsfunc()
config.Config.Unmarshalfunc(key string, target any) error
config.DataSourcesConfig.Primaryfunc() github.com/coldsmirk/vef-framework-go/config.DataSourceConfig
config.EventConfig.EffectiveAsyncQueueSizefunc() int
config.EventConfig.EffectiveAsyncWorkersfunc() int
config.EventConfig.EffectiveDefaultTransportfunc() string
config.EventConfig.EffectivePublishTimeoutfunc() time.Duration
config.EventConfig.Validatefunc() error
config.EventInboxConfig.EffectiveCleanupIntervalfunc() time.Duration
config.EventInboxConfig.EffectiveProcessingLeasefunc() time.Duration
config.EventInboxConfig.EffectiveRetentionfunc() time.Duration
config.EventOutboxTransportConfig.EffectiveCleanupIntervalfunc() time.Duration
config.EventOutboxTransportConfig.EffectiveCompletedTTLfunc() time.Duration
config.LockoutConfig.IsEnabledfunc() bool
config.LockoutConfig.EffectiveMaxFailuresfunc() int
config.LockoutConfig.EffectiveWindowfunc() time.Duration
config.LockoutConfig.EffectiveLockDurationfunc() time.Duration
config.LockoutConfig.EffectiveStrategyfunc() github.com/coldsmirk/vef-framework-go/config.LockoutStrategy
config.LockoutConfig.EffectiveBackoffBasefunc() time.Duration
config.LockoutConfig.EffectiveBackoffMaxfunc() time.Duration
config.LockoutConfig.EffectiveKeyfunc() github.com/coldsmirk/vef-framework-go/config.LockoutKey
config.LockoutConfig.Validatefunc() error
config.SecurityConfig.EffectiveTokenTypefunc() github.com/coldsmirk/vef-framework-go/config.TokenType
config.SecurityConfig.Validatefunc() error
config.SessionConfig.EffectiveOnExceedfunc() github.com/coldsmirk/vef-framework-go/config.SessionExceedPolicy
config.SessionConfig.EffectiveIdleTTLfunc() time.Duration
config.SessionConfig.EffectiveMaxLifetimefunc() time.Duration
config.SessionConfig.IsSlidingfunc() bool
config.StorageConfig.EffectiveClaimTTLfunc() time.Duration
config.StorageConfig.EffectiveDeleteBatchSizefunc() int
config.StorageConfig.EffectiveDeleteConcurrencyfunc() int
config.StorageConfig.EffectiveDeleteLeaseWindowfunc() time.Duration
config.StorageConfig.EffectiveDeleteMaxAttemptsfunc() int
config.StorageConfig.EffectiveDeleteWorkerIntervalfunc() time.Duration
config.StorageConfig.EffectiveMaxPendingClaimsfunc() int
config.StorageConfig.EffectiveMaxUploadSizefunc() int64
config.StorageConfig.EffectiveSweepBatchSizefunc() int
config.StorageConfig.EffectiveSweepIntervalfunc() time.Duration

Method Semantics

Method familyBehavior
config.Config.Unmarshal(key, target)Reads the requested key into target; the internal Viper-backed implementation uses config struct tags and ignores untagged fields.
config.DataSourcesConfig.Primary()Returns Map[config.PrimaryDataSourceName]. If the map lacks primary, the method returns the zero config.DataSourceConfig; framework startup validates the primary entry separately.
config.ApprovalConfig.ApplyDefaults()Mutates the receiver in place. Non-positive durations and counts become: timeout scan 1m, pre-warning scan 5m, cleanup scan 24h, delegation max depth 10, form snapshot retention 90d, urge record retention 30d, CC record retention 90d. It does not enable AutoMigrate.
config.StorageConfig.Effective...Each storage accessor returns the configured value only when it is strictly positive; zero or negative values re-select the exported default constants. Defaults are: max upload size config.DefaultMaxUploadSize (1073741824, 1 GiB), claim TTL config.DefaultClaimTTL (24h), max pending claims 100, sweep interval 5m, sweep batch size 200, delete worker interval 5m, delete batch size 100, delete concurrency 8, delete max attempts 12, delete lease window 5m.
config.EventConfig.EffectiveDefaultTransport()Returns DefaultTransport or "memory" when unset.
config.EventConfig.EffectiveAsyncQueueSize()Returns AsyncQueueSize when positive, otherwise 4096.
config.EventConfig.EffectiveAsyncWorkers()Returns AsyncWorkers when positive, otherwise 4.
config.EventConfig.EffectivePublishTimeout()Returns PublishTimeout when positive, otherwise 5s.
config.EventOutboxTransportConfig.EffectiveCleanupInterval()Returns CleanupInterval when positive, otherwise 1h.
config.EventOutboxTransportConfig.EffectiveCompletedTTL()Returns CompletedTTL when positive, otherwise 168h.
config.EventInboxConfig.EffectiveRetention()Returns Retention when positive, otherwise 168h.
config.EventInboxConfig.EffectiveProcessingLease()Returns ProcessingLease when positive, otherwise 10m.
config.EventInboxConfig.EffectiveCleanupInterval()Returns CleanupInterval when positive, otherwise 1h.
config.EventConfig.Validate()Runs only when EventConfig.Middleware.Inbox is true and EventConfig.Transports.Outbox.Enabled is true. It treats max_retries <= 0 as 10, computes the worst-case exponential backoff horizon as sum(2^k seconds), saturates overflow fail-closed, and returns an error wrapping config.ErrInboxRetentionTooShort when inbox.retention <= horizon.
config.SecurityConfig.EffectiveTokenType()Returns TokenType or config.TokenTypeJWT ("jwt_token") when unset.
config.SecurityConfig.Validate()Rejects an out-of-enum TokenType (wrapping config.ErrInvalidTokenType) or SessionConfig.OnExceed (wrapping config.ErrInvalidSessionOnExceed) so a configuration typo fails fast at boot.
config.LockoutConfig.IsEnabled()Returns true when Enabled is nil (lockout is on by default) or when it points to true.
config.LockoutConfig.Effective...()Each accessor returns the configured value only when it is strictly positive, otherwise it re-selects the matching default constant: MaxFailures -> config.DefaultLockoutMaxFailures (10), Window -> config.DefaultLockoutWindow (15m), LockDuration -> config.DefaultLockoutLockDuration (15m), Strategy -> config.LockoutStrategyLock ("lock") when unset, BackoffBase -> config.DefaultLockoutBackoffBase (1s), BackoffMax -> config.DefaultLockoutBackoffMax (15m), Key -> config.LockoutKeyUserIP ("user_ip") when unset.
config.LockoutConfig.Validate()Rejects an out-of-enum Strategy (wrapping config.ErrInvalidLockoutStrategy) or Key (wrapping config.ErrInvalidLockoutKey).
config.SessionConfig.EffectiveOnExceed()Returns OnExceed or config.SessionExceedEvictOldest ("evict_oldest") when unset.
config.SessionConfig.EffectiveIdleTTL()Returns IdleTTL when positive, otherwise config.DefaultSessionIdleTTL (30m).
config.SessionConfig.EffectiveMaxLifetime()Returns MaxLifetime when positive, otherwise config.DefaultSessionMaxLifetime (7 * 24h).
config.SessionConfig.IsSliding()Returns true when Sliding is nil (idle-timeout renewal is on by default) or when it points to true.

DataSourcesConfig.Map is intentionally untagged. The internal config module unmarshals vef.data_sources into a map[string]config.DataSourceConfig first and then wraps it in DataSourcesConfig{Map: sources}; this preserves arbitrary data-source names while still reserving config.PrimaryDataSourceName ("primary") for the framework-wide orm.DB.

See also