Documentation ¶
Index ¶
- Constants
- Variables
- func AsBytes(v interface{}) []byte
- func DisableKeyNameTracking()
- func EnableKeyNameTracking()
- type Beginner
- type DebugBatch
- func (b *DebugBatch) Begin(writable bool) KeyValueTxn
- func (b *DebugBatch) BeginWithPrefix(writable bool, prefix string) 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.NotFound
ErrNotFound is returned by KeyValueDB.Get if the key is not found.
View Source
var ErrNotOpen = errors.InternalError.With("not open")
ErrNotOpen is returned by KeyValueDB.Get, .Put, and .Close if the database is not open.
Functions ¶
func DisableKeyNameTracking ¶
func DisableKeyNameTracking()
func EnableKeyNameTracking ¶
func EnableKeyNameTracking()
Types ¶
type Beginner ¶
type Beginner interface { // Begin begins a transaction or sub-transaction. Begin(writable bool) KeyValueTxn // Begin begins a transaction or sub-transaction with the given prefix // applied to keys. BeginWithPrefix(writable bool, prefix string) KeyValueTxn }
type DebugBatch ¶
type DebugBatch struct { Batch KeyValueTxn Logger Logger Writable bool // contains filtered or unexported fields }
func (*DebugBatch) Begin ¶
func (b *DebugBatch) Begin(writable bool) KeyValueTxn
func (*DebugBatch) BeginWithPrefix ¶
func (b *DebugBatch) BeginWithPrefix(writable bool, prefix string) KeyValueTxn
func (*DebugBatch) Commit ¶
func (b *DebugBatch) Commit() error
func (*DebugBatch) Discard ¶
func (b *DebugBatch) Discard()
func (*DebugBatch) PretendWrite ¶
func (b *DebugBatch) PretendWrite()
type Key ¶
func (Key) MarshalJSON ¶
MarshalJSON is implemented for JSON-based logging
type KeyValueStore ¶
type KeyValueTxn ¶
Click to show internal directories.
Click to hide internal directories.