testutil

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRecordsToBatch

func AddRecordsToBatch(batch chunk.WriteBatch, tableName string, start, numRecords int)

func AddRecordsToDB

func AddRecordsToDB(t *testing.T, path string, dbClient *local.BoltIndexClient, start, numRecords int)

func CompareDBs

func CompareDBs(t *testing.T, db1, db2 *bbolt.DB)

func SetupDBTablesAtPath

func SetupDBTablesAtPath(t *testing.T, tableName, path string, dbs map[string]DBRecords) string

func TestMultiTableQuery

func TestMultiTableQuery(t *testing.T, queries []chunk.IndexQuery, querier MultiTableQuerier, start, numRecords int)

func TestSingleDBQuery

func TestSingleDBQuery(t *testing.T, query chunk.IndexQuery, db *bbolt.DB, querier SingleDBQuerier, start, numRecords int)

func TestSingleQuery

func TestSingleQuery(t *testing.T, query chunk.IndexQuery, querier SingleTableQuerier, start, numRecords int)

Types

type DBRecords

type DBRecords struct {
	Start, NumRecords int
}

type MultiTableQuerier

type MultiTableQuerier interface {
	QueryPages(ctx context.Context, queries []chunk.IndexQuery, callback chunk_util.Callback) error
}

type SingleDBQuerier

type SingleDBQuerier interface {
	QueryDB(ctx context.Context, db *bbolt.DB, query chunk.IndexQuery, callback func(chunk.IndexQuery, chunk.ReadBatch) (shouldContinue bool)) error
}

type SingleTableQuerier

type SingleTableQuerier interface {
	Query(ctx context.Context, query chunk.IndexQuery, callback chunk_util.Callback) error
}

Jump to

Keyboard shortcuts

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