Documentation ¶
Index ¶
- func AllKeyValueTesting(rnd *rand.Rand, body, setup func(KeyValue) DB, teardown func(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, kv KeyValue, p DB, setup func(KeyValue) DB, teardown func(DB))
- func Max(x, y int) int
- func Min(x, y int) int
- 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 RunSuite(t GinkgoTestingT, name string)
- func ShuffledIndex(rnd *rand.Rand, n, round int, fn func(i int))
- func TestFind(db Find, kv KeyValue)
- func TestFindAfterLast(db Find, kv KeyValue)
- func TestGet(db Get, kv KeyValue)
- func TestHas(db Has, kv KeyValue)
- func TestIter(db NewIterator, r *util.Range, kv KeyValue)
- 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 Has
- 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 KeyvalueBigvalue() *KeyValue
- func KeyvalueEmptykey() *KeyValue
- func KeyvalueEmptyvalue() *KeyValue
- func KeyvalueGenerate(rnd *rand.Rand, n, incr, minlen, maxlen, vminlen, vmaxlen int) *KeyValue
- func KeyvalueMultiplekeyvalue() *KeyValue
- func KeyvalueOnekeyvalue() *KeyValue
- func KeyvalueSpecialkey() *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) CloseCheck()
- func (s *Storage) Counter(m StorageMode, t storage.FileType) (count int, bytes int64)
- func (s *Storage) Create(fd storage.FileDesc) (w storage.Writer, err error)
- func (s *Storage) EmulateError(m StorageMode, t storage.FileType, err error)
- func (s *Storage) EmulateErrorOnce(m StorageMode, t storage.FileType, err error)
- func (s *Storage) EmulateRandomError(m StorageMode, t storage.FileType, prob float64, err error)
- func (s *Storage) ForceRemove(fd storage.FileDesc) (err error)
- func (s *Storage) ForceRename(oldfd, newfd storage.FileDesc) (err error)
- func (s *Storage) GetMeta() (fd storage.FileDesc, err error)
- func (s *Storage) List(t storage.FileType) (fds []storage.FileDesc, err error)
- func (s *Storage) Lock() (l storage.Locker, err error)
- func (s *Storage) Log(str string)
- func (s *Storage) OnClose(onClose func() (preserve bool, err error))
- func (s *Storage) OnLog(onLog func(log string))
- func (s *Storage) Open(fd storage.FileDesc) (r storage.Reader, err error)
- func (s *Storage) Release(m StorageMode, t storage.FileType)
- func (s *Storage) Remove(fd storage.FileDesc) (err error)
- func (s *Storage) Rename(oldfd, newfd storage.FileDesc) (err error)
- func (s *Storage) ResetCounter(m StorageMode, t storage.FileType)
- func (s *Storage) SetMeta(fd storage.FileDesc) error
- func (s *Storage) Stall(m StorageMode, t storage.FileType)
- type StorageMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllKeyValueTesting ¶
func BytesAfter ¶
func BytesSeparator ¶
func DoDBTesting ¶
func DoDBTesting(t *DBTesting)
func DoIteratorTesting ¶
func DoIteratorTesting(t *IteratorTesting)
func KeyValueTesting ¶
func RandomSeed ¶
func RandomSeed() int64
func TestFindAfterLast ¶
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 KeyvalueBigvalue ¶
func KeyvalueBigvalue() *KeyValue
func KeyvalueEmptykey ¶
func KeyvalueEmptykey() *KeyValue
func KeyvalueEmptyvalue ¶
func KeyvalueEmptyvalue() *KeyValue
func KeyvalueGenerate ¶
func KeyvalueMultiplekeyvalue ¶
func KeyvalueMultiplekeyvalue() *KeyValue
func KeyvalueOnekeyvalue ¶
func KeyvalueOnekeyvalue() *KeyValue
func KeyvalueSpecialkey ¶
func KeyvalueSpecialkey() *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) CloseCheck ¶
func (s *Storage) CloseCheck()
func (*Storage) EmulateError ¶
func (s *Storage) EmulateError(m StorageMode, t storage.FileType, err error)
func (*Storage) EmulateErrorOnce ¶
func (s *Storage) EmulateErrorOnce(m StorageMode, t storage.FileType, err error)
func (*Storage) EmulateRandomError ¶
func (*Storage) ForceRename ¶
func (*Storage) ResetCounter ¶
func (s *Storage) ResetCounter(m StorageMode, t storage.FileType)
type StorageMode ¶
type StorageMode int
const ( ModeOpen StorageMode = 1 << iota ModeCreate ModeRemove ModeRename ModeRead ModeWrite ModeSync ModeClose )
Click to show internal directories.
Click to hide internal directories.