Documentation
¶
Index ¶
Constants ¶
View Source
const StoreCtxKey storeCtxKey = "store"
Variables ¶
View Source
var ConfigDefaults = Defaults{ prefsName("stillbox"): MustMarshal(Defaults{ "calls.view.showSourceAlias": false, "calls.view.showTranscripts": false, }), }
View Source
var (
ErrNoSetting = errors.New("no such setting")
)
Functions ¶
func MustMarshal ¶
func MustMarshal(s any) json.RawMessage
Types ¶
type Store ¶
type Store interface {
// Get gets a setting and unmarshals it into dst.
Get(ctx context.Context, name string) (Setting, error)
// GetPrefs gets system prefs for an app name.
GetPrefs(ctx context.Context, appName string) (json.RawMessage, error)
// SetPrefs sets system prefs for an app name.
SetPrefs(ctx context.Context, appName string, val Setting) error
// Set sets a setting.
Set(ctx context.Context, name string, val Setting) error
// GetInto gets a setting and unmarshals it directly into into.
// It does *not* use the cache, and does *not* support defaults.
GetInto(ctx context.Context, name string, into any) error
// Delete removes a setting.
Delete(ctx context.Context, name string) error
}
Click to show internal directories.
Click to hide internal directories.