Documentation
¶
Index ¶
- Variables
- func SetDefaultBitcaskOptions(bitcaskopts ...bitcask.Option)
- func WithMaxDatafileSize(size int) bitcask.Option
- func WithMaxKeySize(size uint32) bitcask.Option
- func WithMaxValueSize(size uint64) bitcask.Option
- type DB
- func (db *DB) AllStores() map[string]encryptdb.Filer
- func (db *DB) BackupAll(archivePath string) (models.Backup, error)
- func (db *DB) Close(storeName string) error
- func (db *DB) CloseAll() error
- func (db *DB) Destroy(storeName string) error
- func (db *DB) Discover() ([]string, error)
- func (db *DB) Init(storeName string, opts ...any) error
- func (db *DB) Meta() models.Metadata
- func (db *DB) Path() string
- func (db *DB) RestoreAll(archivePath string) error
- func (db *DB) Sync(storeName string) error
- func (db *DB) SyncAll() error
- func (db *DB) SyncAndCloseAll() error
- func (db *DB) Type() string
- func (db *DB) With(storeName string) encryptdb.Filer
- func (db *DB) WithNew(storeName string, opts ...any) encryptdb.Filer
- type Store
- func (s *Store) Backend() any
- func (s *Store) Close() error
- func (s *Store) Get(key []byte) ([]byte, error)
- func (s *Store) Keys() (keys [][]byte)
- func (s *Store) PrefixScan(prefix string) (<-chan keyvalue.KeyValue, chan error)
- func (s *Store) Search(query string) (<-chan keyvalue.KeyValue, chan error)
- func (s *Store) ValueExists(value []byte) (key []byte, ok bool)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func SetDefaultBitcaskOptions ¶
SetDefaultBitcaskOptions options will set the options used for all subsequent bitcask stores that are initialized.
func WithMaxDatafileSize ¶
WithMaxDatafileSize is a shim for bitcask's WithMaxDataFileSize function.
func WithMaxKeySize ¶
WithMaxKeySize is a shim for bitcask's WithMaxKeySize function.
func WithMaxValueSize ¶
WithMaxValueSize is a shim for bitcask's WithMaxValueSize function.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB is a mapper of a Filer and Searcher implementation using Bitcask.
func OpenDB ¶
OpenDB will either open an existing set of bitcask datastores at the given directory, or it will create a new one.
func (*DB) AllStores ¶
AllStores returns a map of the names of all bitcask datastores and the corresponding Filers.
func (*DB) Discover ¶
Discover will discover and initialize all existing bitcask stores at the path opened by OpenDB.
func (*DB) Meta ¶
Meta returns the models.Metadata implementation of the bitcask keeper.
func (*DB) RestoreAll ¶
func (*DB) SyncAll ¶
SyncAll syncs all pogreb datastores. TODO: investigate locking here, right now if we try to hold a lock during a backup we'll hang :^)
func (*DB) SyncAndCloseAll ¶
SyncAndCloseAll implements the method from Keeper to sync and close all bitcask stores.
func (*DB) Type ¶
Type returns the type of keeper, in this case "bitcask". This is in order to implement [database.Keeper].
type Store ¶
Store is an implmentation of a Filer and a Searcher using Bitcask.
func (*Store) PrefixScan ¶
PrefixScan will scan a Store for all keys that have a matching prefix of the given string and return a map of keys and values. (map[Key]Value)