Discover Packages
github.com/FreshMag/sforza
internal
config
package
Version:
v0.2.0
Opens a new window with list of versions in this module.
Published: Jun 11, 2026
License: Apache-2.0
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package config loads and validates the Sforza service configuration.
type Auth struct {
Enabled *bool `yaml:"enabled"`
Issuer string `yaml:"issuer"`
Audience string `yaml:"audience"`
DefaultSub string `yaml:"default-sub"`
}
Auth holds OIDC authentication settings. Enabled defaults to true so that
security is opt-out, never accidentally off.
IsEnabled reports whether authentication is enabled (default true).
type Bootstrap struct {
AdminSub string `yaml:"admin-sub"`
Files []string `yaml:"files"`
}
Bootstrap holds startup synchronization settings.
type Config struct {
Server Server `yaml:"server"`
Auth Auth `yaml:"auth"`
Bootstrap Bootstrap `yaml:"bootstrap"`
Storage Storage `yaml:"storage"`
}
Config is the root service configuration.
Load reads, env-expands, parses and validates the configuration file at
path. Environment variables are expanded with ${VAR} / $VAR syntax, which
is how Docker deployments inject secrets.
Parse parses and validates a YAML configuration document.
type DB struct {
Driver string `yaml:"driver"`
DSN string `yaml:"dsn"`
}
DB is a single database connection definition.
type Server struct {
Address string `yaml:"address"`
}
Server holds HTTP server settings.
type Storage struct {
Shared DB `yaml:"shared"`
Tenants map[string ]DB `yaml:"tenants"`
}
Storage declares the shared database and one database per tenant. The keys
of Tenants are the full set of tenant IDs the service accepts.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.