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]database.Filer
- func (db *DB) Close(storeName string) error
- func (db *DB) CloseAll() error
- func (db *DB) Discover() ([]string, error)
- func (db *DB) Init(storeName string, opts ...any) error
- func (db *DB) Path() string
- func (db *DB) Sync(storeName string) error
- func (db *DB) SyncAll() error
- func (db *DB) SyncAndCloseAll() error
- func (db *DB) With(storeName string) database.Store
- func (db *DB) WithNew(storeName string, opts ...any) database.Filer
- type Store
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func SetDefaultBitcaskOptions ¶
func SetDefaultBitcaskOptions(bitcaskopts ...bitcask.Option)
SetDefaultBitcaskOptions options will set the options used for all subsequent bitcask stores that are initialized.
func WithMaxDatafileSize ¶
func WithMaxDatafileSize(size int) bitcask.Option
WithMaxDatafileSize is a shim for bitcask's WithMaxDataFileSize function.
func WithMaxKeySize ¶
func WithMaxKeySize(size uint32) bitcask.Option
WithMaxKeySize is a shim for bitcask's WithMaxKeySize function.
func WithMaxValueSize ¶
func WithMaxValueSize(size uint64) bitcask.Option
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) SyncAndCloseAll ¶
SyncAndCloseAll implements the method from Keeper to sync and close all bitcask stores.
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)