Documentation
¶
Overview ¶
Package settings is a platform module: business settings of the project, stored in the database and editable without a deploy.
The schema is generated from settings.yaml and comes from project code; the module adds storage, caching, refresh and the store in the container.
Index ¶
Constants ¶
const DefaultTable = "platform_settings"
DefaultTable is where overrides are stored.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Table string // table holding the overrides
// RefreshInterval is how often values are re-read, so a change made on one instance
// reaches the others. Zero disables the refresh loop.
RefreshInterval time.Duration
}
Config holds module settings. Load fills it from the environment; the platform generator writes the Load call into the project's config.gen.go.
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module implements platform.Module.
func (*Module) Health ¶
Health fails when the settings cannot be re-read: the application still works on the cached values, yet a change would not reach it, and that must be visible.
func (*Module) Init ¶
Init creates the table, loads the values and puts the store into the container, where project code picks it up through the generated accessors.