Documentation ¶
Index ¶
- type BinaryStreamFileIterator
- type BinaryStreamFileWriter
- type BinaryStreamIterator
- type BinaryStreamWriter
- type InMemoryKVStore
- func (im InMemoryKVStore) Get(k []byte) []byte
- func (im InMemoryKVStore) Has(k []byte) bool
- func (im InMemoryKVStore) Iterate(f func(k []byte, v []byte) bool)
- func (im InMemoryKVStore) IterateKeys(f func(k []byte) bool)
- func (im InMemoryKVStore) Iterator(prefix []byte) trie.KVIterator
- func (im InMemoryKVStore) Set(k, v []byte)
- type KVStreamIterator
- type KVStreamWriter
- type PseudoRandStreamIterator
- type PseudoRandStreamParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryStreamFileIterator ¶
type BinaryStreamFileIterator struct { *BinaryStreamIterator // contains filtered or unexported fields }
func OpenKVStreamFile ¶
func OpenKVStreamFile(fname string) (*BinaryStreamFileIterator, error)
OpenKVStreamFile opens existing file with key/value stream for reading
func (*BinaryStreamFileIterator) Close ¶
func (fs *BinaryStreamFileIterator) Close() error
type BinaryStreamFileWriter ¶
type BinaryStreamFileWriter struct { *BinaryStreamWriter // contains filtered or unexported fields }
func CreateKVStreamFile ¶
func CreateKVStreamFile(fname string) (*BinaryStreamFileWriter, error)
CreateKVStreamFile create a new BinaryStreamFileWriter
func (*BinaryStreamFileWriter) Close ¶
func (fw *BinaryStreamFileWriter) Close() error
type BinaryStreamIterator ¶
type BinaryStreamIterator struct {
// contains filtered or unexported fields
}
func NewBinaryStreamIterator ¶
func NewBinaryStreamIterator(r io.Reader) *BinaryStreamIterator
type BinaryStreamWriter ¶
type BinaryStreamWriter struct {
// contains filtered or unexported fields
}
func NewBinaryStreamWriter ¶
func NewBinaryStreamWriter(w io.Writer) *BinaryStreamWriter
func (*BinaryStreamWriter) Stats ¶
func (b *BinaryStreamWriter) Stats() (int, int)
func (*BinaryStreamWriter) Write ¶
func (b *BinaryStreamWriter) Write(key, value []byte) error
type InMemoryKVStore ¶
func NewInMemoryKVStore ¶
func NewInMemoryKVStore() InMemoryKVStore
func (InMemoryKVStore) Get ¶
func (im InMemoryKVStore) Get(k []byte) []byte
func (InMemoryKVStore) Has ¶
func (im InMemoryKVStore) Has(k []byte) bool
func (InMemoryKVStore) IterateKeys ¶
func (im InMemoryKVStore) IterateKeys(f func(k []byte) bool)
func (InMemoryKVStore) Iterator ¶
func (im InMemoryKVStore) Iterator(prefix []byte) trie.KVIterator
func (InMemoryKVStore) Set ¶
func (im InMemoryKVStore) Set(k, v []byte)
type KVStreamIterator ¶
KVStreamIterator is an interface to iterate stream In general, order is non-deterministic
type KVStreamWriter ¶
type KVStreamWriter interface { // Write writes key/value pair Write(key, value []byte) error // Stats return num k/v pairs and num bytes so far Stats() (int, int) }
KVStreamWriter represents an interface to write a sequence of key/value pairs
type PseudoRandStreamIterator ¶
type PseudoRandStreamIterator struct {
// contains filtered or unexported fields
}
func NewPseudoRandStreamIterator ¶
func NewPseudoRandStreamIterator(p ...PseudoRandStreamParams) *PseudoRandStreamIterator
type PseudoRandStreamParams ¶
type PseudoRandStreamParams struct { // Seed for deterministic randomization Seed int64 // NumKVPairs maximum number of key value pairs to generate. 0 means infinite NumKVPairs int // MaxKey maximum length of key (randomly generated) MaxKey int // MaxValue maximum length of value (randomly generated) MaxValue int }
PseudoRandStreamParams represents parameters of the RandStreamIterator
Click to show internal directories.
Click to hide internal directories.