Documentation
¶
Overview ¶
Package settings is a togo plugin: a shared, typed config store that any other plugin can read, write, and share. Values are JSON, addressed by (scope, key) — use scope "global", a plugin name, or a tenant id — and persisted in the kernel DB. Use the Go helpers (Get/Set) or the REST API at /api/settings.
Index ¶
- Constants
- func Get[T any](ctx context.Context, s *Store, scope, key string) (T, bool, error)
- func Set[T any](ctx context.Context, s *Store, scope, key string, v T) error
- type Store
- func (s *Store) All(ctx context.Context, scope string) (map[string]json.RawMessage, error)
- func (s *Store) Delete(ctx context.Context, scope, key string) error
- func (s *Store) Get(ctx context.Context, scope, key string, dst any) (ok bool, err error)
- func (s *Store) Set(ctx context.Context, scope, key string, value any) error
Constants ¶
View Source
const ScopeGlobal = "global"
ScopeGlobal is the default scope for app-wide settings.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the settings service placed in the kernel container under "settings".
func FromKernel ¶
FromKernel returns the settings store, or nil if the plugin isn't installed.
Click to show internal directories.
Click to hide internal directories.