Documentation ¶
Index ¶
- Constants
- Variables
- func DisableKeyNameTracking()
- func EnableKeyNameTracking()
- type DebugBatch
- func (b *DebugBatch) Begin(writable bool) KeyValueTxn
- func (b *DebugBatch) Commit() error
- func (b *DebugBatch) Discard()
- func (b *DebugBatch) Get(key Key) (v []byte, err error)
- func (b *DebugBatch) PretendWrite()
- func (b *DebugBatch) Put(key Key, value []byte) error
- func (b *DebugBatch) PutAll(values map[Key][]byte) error
- type Key
- type KeyValueStore
- type KeyValueTxn
- type Logger
Constants ¶
View Source
const (
KeyLength = 32 // Total bytes used for keys
)
Variables ¶
View Source
var ErrNotFound = errors.StatusNotFound
ErrNotFound is returned by KeyValueDB.Get if the key is not found.
View Source
var ErrNotOpen = errors.New(errors.StatusInternalError, "not open")
ErrNotOpen is returned by KeyValueDB.Get, .Put, and .Close if the database is not open.
Functions ¶
func DisableKeyNameTracking ¶ added in v1.0.0
func DisableKeyNameTracking()
func EnableKeyNameTracking ¶ added in v0.6.0
func EnableKeyNameTracking()
Types ¶
type DebugBatch ¶ added in v0.5.1
type DebugBatch struct { Batch KeyValueTxn Logger Logger Writable bool // contains filtered or unexported fields }
func (*DebugBatch) Begin ¶ added in v0.5.1
func (b *DebugBatch) Begin(writable bool) KeyValueTxn
func (*DebugBatch) Commit ¶ added in v0.5.1
func (b *DebugBatch) Commit() error
func (*DebugBatch) Discard ¶ added in v0.5.1
func (b *DebugBatch) Discard()
func (*DebugBatch) PretendWrite ¶ added in v0.5.1
func (b *DebugBatch) PretendWrite()
type Key ¶
func (Key) MarshalJSON ¶
MarshalJSON is implemented for JSON-based logging
type KeyValueStore ¶
type KeyValueStore interface { // Close closes the store. Close() error // Begin begins a transaction. Begin(writable bool) KeyValueTxn }
type KeyValueTxn ¶
type KeyValueTxn interface { // Get gets a value. Get(key Key) ([]byte, error) // Put puts a value. Put(key Key, value []byte) error // PutAll puts many values. PutAll(map[Key][]byte) error // Commit commits the transaction. Commit() error // Discard discards the transaction. Discard() // Begin begins a sub-transaction. Begin(writable bool) KeyValueTxn }
Click to show internal directories.
Click to hide internal directories.