Documentation
¶
Overview ¶
Package testutil provides test helpers for BeachDB.
- Model: Reference implementation for verifying database correctness - RandKey, RandValue: Random data generators for crash-loop testing
Index ¶
- func RandKey(rng *rand.Rand, maxLen int) []byte
- func RandValue(rng *rand.Rand, maxLen int) []byte
- type Model
- func (m *Model) Delete(key []byte)
- func (m *Model) DeleteAt(key []byte, seqno uint64)
- func (m *Model) Get(key []byte) ([]byte, bool)
- func (m *Model) GetAt(key []byte, seqno uint64) ([]byte, bool)
- func (m *Model) Keys() [][]byte
- func (m *Model) Len() int
- func (m *Model) Put(key, value []byte)
- func (m *Model) PutAt(key, value []byte, seqno uint64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is a reference implementation for testing memtable correctness. It stores all versions of all keys to support snapshot reads.
func (*Model) GetAt ¶ added in v0.0.2
GetAt returns the value for key at the given seqno. Returns the newest version with seqno <= target. Returns (nil, true) if the newest visible version is a tombstone. Returns (nil, false) if no version exists for the key.
Click to show internal directories.
Click to hide internal directories.