Documentation ¶
Index ¶
- func DisableLogWrites()
- func EnableLogWrites()
- func NewBatch(prefix string, get GetFunc, commit CommitFunc) storage.KeyValueTxn
- type Batch
- func (b *Batch) Begin(writable bool) storage.KeyValueTxn
- func (b *Batch) BeginWithPrefix(writable bool, prefix string) storage.KeyValueTxn
- func (b *Batch) Commit() error
- func (b *Batch) Copy() *Batch
- func (b *Batch) Discard()
- func (b *Batch) Get(key storage.Key) (v []byte, err error)
- func (b *Batch) Put(key storage.Key, value []byte) error
- func (b *Batch) PutAll(values map[storage.Key][]byte) error
- type CommitFunc
- type DB
- type GetFunc
- type PrefixedKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableLogWrites ¶
func DisableLogWrites()
func EnableLogWrites ¶
func EnableLogWrites()
func NewBatch ¶
func NewBatch(prefix string, get GetFunc, commit CommitFunc) storage.KeyValueTxn
Types ¶
type Batch ¶
type Batch struct {
// contains filtered or unexported fields
}
func (*Batch) BeginWithPrefix ¶
func (b *Batch) BeginWithPrefix(writable bool, prefix string) storage.KeyValueTxn
type CommitFunc ¶
type CommitFunc func(map[PrefixedKey][]byte) error
type DB ¶
type DB struct { DBOpen atomicBool // contains filtered or unexported fields }
DB Implements a key value store in memory. Very basic, assumes no initial state for the database That must be handled by the caller, but see the notes on InitDB for future improvements.
func (*DB) BeginWithPrefix ¶
func (db *DB) BeginWithPrefix(writable bool, prefix string) storage.KeyValueTxn
func (*DB) MarshalJSON ¶
func (*DB) UnmarshalJSON ¶
type PrefixedKey ¶
func (PrefixedKey) String ¶
func (k PrefixedKey) String() string
Click to show internal directories.
Click to hide internal directories.