Documentation ¶
Index ¶
- func AllKeyValueTesting(rnd *rand.Rand, body func(kv KeyValue) DB)
- func BytesAfter(b []byte) []byte
- func BytesSeparator(a, b []byte) []byte
- func Defer(args ...interface{}) bool
- func DoDBTesting(t *DBTesting)
- func DoIteratorTesting(t *IteratorTesting)
- func KeyValueTesting(rnd *rand.Rand, p DB, kv KeyValue)
- func NewRand() *rand.Rand
- func RandomIndex(rnd *rand.Rand, n, round int, fn func(i int))
- func RandomRange(rnd *rand.Rand, n, round int, fn func(start, limit int))
- func RandomSeed() int64
- func RunDefer(groups ...string) bool
- func ShuffledIndex(rnd *rand.Rand, n, round int, fn func(i int))
- type DB
- type DBAct
- type DBTesting
- func (t *DBTesting) Delete(key []byte)
- func (t *DBTesting) DeleteRandom() bool
- func (t *DBTesting) Put(key, value []byte)
- func (t *DBTesting) PutRandom() bool
- func (t *DBTesting) RandomAct(round int)
- func (t *DBTesting) TestAll()
- func (t *DBTesting) TestAllDeleted()
- func (t *DBTesting) TestAllPresent()
- func (t *DBTesting) TestDeletedKey(key []byte)
- func (t *DBTesting) TestPresentKV(key, value []byte)
- func (t *DBTesting) Text() string
- type Delete
- type Find
- type Get
- type IterAct
- type IteratorTesting
- func (t *IteratorTesting) EOI()
- func (t *IteratorTesting) First()
- func (t *IteratorTesting) IsFirst() bool
- func (t *IteratorTesting) IsLast() bool
- func (t *IteratorTesting) Last()
- func (t *IteratorTesting) Next()
- func (t *IteratorTesting) NextAll()
- func (t *IteratorTesting) Prev()
- func (t *IteratorTesting) PrevAll()
- func (t *IteratorTesting) SOI()
- func (t *IteratorTesting) Seek(i int)
- func (t *IteratorTesting) SeekInexact(i int)
- func (t *IteratorTesting) SeekKey(key []byte)
- func (t *IteratorTesting) TestKV()
- func (t *IteratorTesting) Text() string
- func (t *IteratorTesting) WalkNext(fn func(t *IteratorTesting))
- func (t *IteratorTesting) WalkPrev(fn func(t *IteratorTesting))
- type KeyValue
- func KeyValue_BigValue() *KeyValue
- func KeyValue_EmptyKey() *KeyValue
- func KeyValue_EmptyValue() *KeyValue
- func KeyValue_Generate(rnd *rand.Rand, n, minlen, maxlen, vminlen, vmaxlen int) *KeyValue
- func KeyValue_MultipleKeyValue() *KeyValue
- func KeyValue_OneKeyValue() *KeyValue
- func KeyValue_SpecialKey() *KeyValue
- func (kv KeyValue) Clone() KeyValue
- func (kv *KeyValue) Delete(key []byte) (exist bool, value []byte)
- func (kv *KeyValue) DeleteIndex(i int) bool
- func (kv KeyValue) Get(key []byte) (i int, exist bool)
- func (kv KeyValue) GetString(key string) (i int, exist bool)
- func (kv KeyValue) Index(i int) (key, value []byte)
- func (kv KeyValue) IndexInexact(i int) (key_, key, value []byte)
- func (kv KeyValue) IndexOrNil(i int) (key, value []byte)
- func (kv KeyValue) IndexString(i int) (key, value string)
- func (kv KeyValue) Iterate(fn func(i int, key, value []byte))
- func (kv KeyValue) IterateInexact(fn func(i int, key_, key, value []byte))
- func (kv KeyValue) IterateInexactString(fn func(i int, key_, key, value string))
- func (kv KeyValue) IterateShuffled(rnd *rand.Rand, fn func(i int, key, value []byte))
- func (kv KeyValue) IterateShuffledString(rnd *rand.Rand, fn func(i int, key, value string))
- func (kv KeyValue) IterateString(fn func(i int, key, value string))
- func (kv KeyValue) KeyAt(i int) []byte
- func (kv KeyValue) Len() int
- func (kv *KeyValue) Put(key, value []byte)
- func (kv *KeyValue) PutString(key, value string)
- func (kv *KeyValue) PutU(key, value []byte) bool
- func (kv *KeyValue) PutUString(key, value string) bool
- func (kv KeyValue) Range(start, limit int) (r util.Range)
- func (kv KeyValue) Search(key []byte) int
- func (kv KeyValue) SearchString(key string) int
- func (kv *KeyValue) Size() int
- func (kv KeyValue) Slice(start, limit int) KeyValue
- func (kv KeyValue) SliceKey(start, limit []byte) KeyValue
- func (kv KeyValue) SliceKeyString(start, limit string) KeyValue
- func (kv KeyValue) SliceRange(r *util.Range) KeyValue
- func (kv KeyValue) ValueAt(i int) []byte
- type KeyValueEntry
- type NewIterator
- type Put
- type Storage
- func (s *Storage) Close() error
- func (s *Storage) Counter(m StorageMode, t storage.FileType) (count int, bytes int64)
- func (s *Storage) EmulateError(m StorageMode, t storage.FileType, err error)
- func (s *Storage) GetFile(num uint64, t storage.FileType) storage.File
- func (s *Storage) GetFiles(t storage.FileType) (files []storage.File, err error)
- func (s *Storage) GetManifest() (f storage.File, err error)
- func (s *Storage) Lock() (r util.Releaser, err error)
- func (s *Storage) Log(str string)
- func (s *Storage) Release(m StorageMode, t storage.FileType)
- func (s *Storage) ResetCounter(m StorageMode, t storage.FileType)
- func (s *Storage) SetManifest(f storage.File) error
- func (s *Storage) Stall(m StorageMode, t storage.FileType)
- type StorageMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesAfter ¶
func BytesSeparator ¶
func DoDBTesting ¶
func DoDBTesting(t *DBTesting)
func DoIteratorTesting ¶
func DoIteratorTesting(t *IteratorTesting)
func RandomSeed ¶
func RandomSeed() int64
Types ¶
type DBTesting ¶
type DBTesting struct { Rand *rand.Rand DB interface { Get Put Delete } PostFn func(t *DBTesting) Deleted, Present KeyValue Act, LastAct DBAct ActKey, LastActKey []byte }
func (*DBTesting) DeleteRandom ¶
func (*DBTesting) TestAllDeleted ¶
func (t *DBTesting) TestAllDeleted()
func (*DBTesting) TestAllPresent ¶
func (t *DBTesting) TestAllPresent()
func (*DBTesting) TestDeletedKey ¶
func (*DBTesting) TestPresentKV ¶
type IteratorTesting ¶
type IteratorTesting struct { KeyValue Iter iterator.Iterator Rand *rand.Rand PostFn func(t *IteratorTesting) Pos int Act, LastAct IterAct // contains filtered or unexported fields }
func (*IteratorTesting) EOI ¶
func (t *IteratorTesting) EOI()
func (*IteratorTesting) First ¶
func (t *IteratorTesting) First()
func (*IteratorTesting) IsFirst ¶
func (t *IteratorTesting) IsFirst() bool
func (*IteratorTesting) IsLast ¶
func (t *IteratorTesting) IsLast() bool
func (*IteratorTesting) Last ¶
func (t *IteratorTesting) Last()
func (*IteratorTesting) Next ¶
func (t *IteratorTesting) Next()
func (*IteratorTesting) NextAll ¶
func (t *IteratorTesting) NextAll()
func (*IteratorTesting) Prev ¶
func (t *IteratorTesting) Prev()
func (*IteratorTesting) PrevAll ¶
func (t *IteratorTesting) PrevAll()
func (*IteratorTesting) SOI ¶
func (t *IteratorTesting) SOI()
func (*IteratorTesting) Seek ¶
func (t *IteratorTesting) Seek(i int)
func (*IteratorTesting) SeekInexact ¶
func (t *IteratorTesting) SeekInexact(i int)
func (*IteratorTesting) SeekKey ¶
func (t *IteratorTesting) SeekKey(key []byte)
func (*IteratorTesting) TestKV ¶
func (t *IteratorTesting) TestKV()
func (*IteratorTesting) Text ¶
func (t *IteratorTesting) Text() string
func (*IteratorTesting) WalkNext ¶
func (t *IteratorTesting) WalkNext(fn func(t *IteratorTesting))
func (*IteratorTesting) WalkPrev ¶
func (t *IteratorTesting) WalkPrev(fn func(t *IteratorTesting))
type KeyValue ¶
type KeyValue struct {
// contains filtered or unexported fields
}
func KeyValue_BigValue ¶
func KeyValue_BigValue() *KeyValue
func KeyValue_EmptyKey ¶
func KeyValue_EmptyKey() *KeyValue
func KeyValue_EmptyValue ¶
func KeyValue_EmptyValue() *KeyValue
func KeyValue_Generate ¶
func KeyValue_MultipleKeyValue ¶
func KeyValue_MultipleKeyValue() *KeyValue
func KeyValue_OneKeyValue ¶
func KeyValue_OneKeyValue() *KeyValue
func KeyValue_SpecialKey ¶
func KeyValue_SpecialKey() *KeyValue
func (*KeyValue) DeleteIndex ¶
func (KeyValue) IndexInexact ¶
func (KeyValue) IndexOrNil ¶
func (KeyValue) IndexString ¶
func (KeyValue) IterateInexact ¶
func (KeyValue) IterateInexactString ¶
func (KeyValue) IterateShuffled ¶
func (KeyValue) IterateShuffledString ¶
func (KeyValue) IterateString ¶
func (*KeyValue) PutUString ¶
func (KeyValue) SearchString ¶
func (KeyValue) SliceKeyString ¶
type KeyValueEntry ¶
type KeyValueEntry struct {
// contains filtered or unexported fields
}
type NewIterator ¶
type Storage ¶
func NewStorage ¶
func NewStorage() *Storage
func (*Storage) EmulateError ¶
func (s *Storage) EmulateError(m StorageMode, t storage.FileType, err error)
func (*Storage) ResetCounter ¶
func (s *Storage) ResetCounter(m StorageMode, t storage.FileType)
type StorageMode ¶
type StorageMode int
const ( ModeOpen StorageMode = 1 << iota ModeCreate ModeRemove ModeRead ModeWrite ModeSync ModeClose )
Click to show internal directories.
Click to hide internal directories.