drivertest

package
v0.2.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, c keyvalue.Connection, t *testing.T)

Run runs the standard tests on the given keyvalue.Connection.

func RunTableTests added in v0.2.8

func RunTableTests(ctx context.Context, db keyvalue.Database, t *testing.T)

RunTableTests runs the standard table tests on the given keyvalue.Database connection.

Types

type RandomIterator added in v0.2.8

type RandomIterator struct {
	// contains filtered or unexported fields
}

RandomIterator is an iterator that generates records containing a large volume of random data. Each record will be of the form:

"id"   => an int64 counter, incremented on each call to Next
"data" => a []byte slice of length 1MB filled with random data

Note that a RandomIterator will generate an infinite number of records. You must wrap it in some form of limiting iterator.

func (*RandomIterator) Close added in v0.2.8

func (itr *RandomIterator) Close() error

Close closes the iterator, preventing further iteration.

func (*RandomIterator) Err added in v0.2.8

func (*RandomIterator) Err() error

Err returns the last error, if any, encountered during iteration. Err may be called after Close.

func (*RandomIterator) Next added in v0.2.8

func (itr *RandomIterator) Next() bool

Next advances the iterator. Returns true on successful advance of the iterator; false otherwise. Next or NextContext must be called before the first call to Scan.

func (*RandomIterator) NextContext added in v0.2.8

func (itr *RandomIterator) NextContext(ctx context.Context) (bool, error)

NextContext advances the iterator. Returns true on successful advance of the iterator; false otherwise. Next or NextContext must be called before the first call to Scan.

func (*RandomIterator) Scan added in v0.2.8

func (itr *RandomIterator) Scan(dest record.Record) error

Scan copies the current record into "dest". Any previously set keys or values in "dest" will be deleted or overwritten.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL