storagetest

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package storagetest contains high level API tests and test utils for other modules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRandBlob added in v0.8.0

func AddRandBlob(
	ctx context.Context,
	objectStorage storage.ObjectStorage,
	jetID core.RecordID,
	pulsenum core.PulseNumber,
) (*core.RecordID, error)

AddRandBlob adds random blob.

func AddRandDrop added in v0.8.0

func AddRandDrop(
	ctx context.Context,
	dropStorage storage.DropStorage,
	jetID core.RecordID,
	pulsenum core.PulseNumber,
) (*jet.JetDrop, error)

AddRandDrop adds random drop.

func AddRandIndex added in v0.8.0

func AddRandIndex(
	ctx context.Context,

	objectStorage storage.ObjectStorage,
	jetID core.RecordID,
	pulsenum core.PulseNumber,
) (*core.RecordID, error)

AddRandIndex adds random index.

func AddRandRecord added in v0.8.0

func AddRandRecord(
	ctx context.Context,
	objectStorage storage.ObjectStorage,
	jetID core.RecordID,
	pulsenum core.PulseNumber,
) (*core.RecordID, error)

AddRandRecord adds random record.

func TmpDB

func TmpDB(ctx context.Context, t testing.TB, options ...Option) (storage.DBContext, func())

TmpDB returns BadgerDB's storage implementation and cleanup function.

Creates BadgerDB in temporary directory and uses t for errors reporting.

Types

type Option added in v0.6.3

type Option func(*tmpDBOptions)

Option provides functional option for TmpDB.

func Dir added in v0.6.3

func Dir(dir string) Option

Dir defines temporary directory for database.

func DisableBootstrap added in v0.6.3

func DisableBootstrap() Option

DisableBootstrap skip bootstrap records creation.

Jump to

Keyboard shortcuts

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