database/keeper.go

19 lines
676 B
Go
Raw Normal View History

2022-01-09 03:01:15 +00:00
package database
// Keeper will be in charge of the more meta operations involving Filers.
// This includes operations like initialization, syncing to disk if applicable, and backing up.
type Keeper interface {
2022-01-19 09:46:51 +00:00
// Path should return the base path where all stores should be stored under. (likely as subdirectories)
2022-01-09 03:01:15 +00:00
Path() string
2022-02-12 07:52:42 +00:00
// Init should initialize our Filer at the given path, to be referenced and called by dataStore.
2022-07-26 04:36:46 +00:00
Init(name string, options ...any) error
2022-02-12 07:52:42 +00:00
// With provides access to the given dataStore by providing a pointer to the related Filer.
2022-07-26 04:36:46 +00:00
With(name string) Store
2022-01-09 03:01:15 +00:00
AllStores() map[string]Filer
2022-01-09 03:01:15 +00:00
// TODO: Backups
CloseAll() error
SyncAll() error
}