testutil

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRecordsToBatch

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

func AddRecordsToDB

func AddRecordsToDB(t testing.TB, path string, start, numRecords int, bucketName []byte)

func BuildUserID

func BuildUserID(id int) string

func DecompressFile

func DecompressFile(t *testing.T, src, dest string)

func SetupDBsAtPath

func SetupDBsAtPath(t *testing.T, path string, dbs map[string]DBConfig, bucketName []byte) string

func SetupTable

func SetupTable(t *testing.T, path string, commonDBsConfig DBsConfig, perUserDBsConfig PerUserDBsConfig)

func VerifyIndexes

func VerifyIndexes(t *testing.T, userID string, queries []index.Query, indexIteratorFunc IndexIteratorFunc, start, numRecords int)

func VerifySingleIndexFile

func VerifySingleIndexFile(t *testing.T, query index.Query, db *bbolt.DB, bucketName []byte, start, numRecords int)

Types

type DBConfig

type DBConfig struct {
	DBRecords
}

ToDo(Sandeep): refactor to remove DBConfig and use DBRecords directly

type DBRecords

type DBRecords struct {
	Start, NumRecords int
}

type DBsConfig

type DBsConfig struct {
	DBRecordsStart                     int
	NumUnCompactedDBs, NumCompactedDBs int
}

func (DBsConfig) String

func (c DBsConfig) String() string

type IndexIteratorFunc

type IndexIteratorFunc func(ctx context.Context, table string, callback func(boltdb *bbolt.DB) error) error

type PerUserDBsConfig

type PerUserDBsConfig struct {
	DBsConfig
	NumUsers int
}

func (PerUserDBsConfig) String

func (c PerUserDBsConfig) String() string

type SingleDBQuerier

type SingleDBQuerier interface {
	QueryDB(ctx context.Context, db *bbolt.DB, bucketName []byte, query index.Query, callback index.QueryPagesCallback) error
}

Jump to

Keyboard shortcuts

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