Documentation
¶
Index ¶
- func MigrateFromGOB(stateRoot string, s *Store) error
- type Option
- type Store
- func (s *Store) Close() error
- func (s *Store) DeletePluginSettings(pluginID string) error
- func (s *Store) LoadAllPluginSettings() (map[string]map[string]any, error)
- func (s *Store) LoadCategory(categoryID string) (map[string]any, error)
- func (s *Store) LoadPluginSettings(pluginID string) (map[string]any, error)
- func (s *Store) SaveCategory(categoryID string, values map[string]any) error
- func (s *Store) SavePluginSettings(pluginID string, values map[string]any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MigrateFromGOB ¶
MigrateFromGOB checks for old GOB settings files and migrates them to bbolt. stateRoot is the absolute path to the state directory (e.g., ~/.omniview). Old files are renamed to .gob.bak after successful migration. Corrupt or unreadable files are skipped and reported in a single aggregated log.
Types ¶
type Option ¶
type Option func(*config)
Option configures the Store. Reserved for future encryption support.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store wraps bbolt for settings persistence.
func Open ¶
Open opens (or creates) a bbolt database at path. Both top-level buckets ("core" and "plugins") are pre-created. If the file is corrupt, it is renamed with a .corrupt.<unix-timestamp> suffix and a fresh database is created in its place.
func (*Store) Close ¶
Close closes the underlying bbolt database. It is safe to call on a nil Store or a Store with a nil db.
func (*Store) DeletePluginSettings ¶
DeletePluginSettings removes a plugin's settings from the "plugins" bucket. It is a no-op if the plugin does not exist.
func (*Store) LoadAllPluginSettings ¶
LoadAllPluginSettings returns all plugin settings keyed by plugin ID. Returns an empty (non-nil) map if no plugins have saved settings.
func (*Store) LoadCategory ¶
LoadCategory retrieves a category's settings from the "core" bucket. Returns an empty (non-nil) map if the category does not exist.
func (*Store) LoadPluginSettings ¶
LoadPluginSettings retrieves a plugin's settings from the "plugins" bucket. Returns an empty (non-nil) map if the plugin does not exist.
func (*Store) SaveCategory ¶
SaveCategory persists a category's settings under the "core" bucket. Values are JSON-encoded and stored under the given categoryID key.