Documentation
¶
Overview ¶
Package config is the app's live settings: declared by the core and by modules, kept in the app's database, and read at the moment of use. A change is stored, then announced on the bus and to watchers; nothing has to restart.
Index ¶
- type Entry
- type Publisher
- type Store
- func (s *Store) Declare(scope string, settings []module.Setting) error
- func (s *Store) Entries() []Entry
- func (s *Store) Get(fullKey string) (any, bool)
- func (s *Store) Reset(ctx context.Context, fullKey string) error
- func (s *Store) Scoped(scope string) module.Config
- func (s *Store) Set(ctx context.Context, fullKey string, value any) error
- func (s *Store) Watch(fullKey string, fn func(any)) (stop func())
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
// Scope is the module id, or "surface" for the core's own.
Scope string `json:"scope"`
module.Setting
// FullKey is "<scope>.<key>".
FullKey string `json:"full_key"`
Value any `json:"value"`
// Set is true when the user has set a value; false means Value is the default.
Set bool `json:"set"`
}
Entry is one setting with its present value, as the settings window lists it.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store holds the declarations and the values.
func (*Store) Declare ¶
Declare registers a scope's settings. A default that does not fit its type is an error.