Documentation
¶
Overview ¶
Package config loads the manager's runtime configuration via viper. Mirrors the server's config-loading style (file + env overrides).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminConfig ¶
type AdminConfig struct {
Bootstrap BootstrapAdmin
}
type BootstrapAdmin ¶
type CORSConfig ¶
type CORSConfig struct {
AllowedOrigins []string
}
type Config ¶
type Config struct {
Server ServerConfig
DB DBConfig
JWT JWTConfig
Admin AdminConfig
Log LogConfig
CORS CORSConfig
}
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the hardcoded default runtime configuration. The DB-backed (hot-reloadable) sections — jwt TTLs, log, cors, and the server read/write timeouts — use these as their seed/default values in the database and are NOT overridden by config.yml file values at runtime. server.port, db.*, jwt.secret and admin.bootstrap are NOT migrated to the database: server.port/db are startup/infra config sourced from config.yml / env (db must exist before the DB can be read; port requires a listener rebind i.e. a restart, so it is not hot-reloadable; secret stays out of the DB by convention).
func Load ¶
Load reads the config file (path, or ./config.yml by default) and applies env overrides. Missing config file is acceptable — defaults/env apply.
Note: server.port, db.*, jwt.secret and admin.bootstrap.* are sourced from this file (startup/infra config). The jwt-ttl/log/cors/server-timeout sections are seeded into the database and managed there at runtime; values present in config.yml for those sections are ignored.