Help us shape the future of Go! Take the 2026 Go Developer Survey

testutil

package
v1.21.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrKeyAccessDeniedError = errors.New("test key access denied")

Functions

func MockStorageBlock

func MockStorageBlock(t testing.TB, bucket objstore.Bucket, userID string, minT, maxT int64) tsdb.BlockMeta

func MockStorageDeletionMark

func MockStorageDeletionMark(t testing.TB, bucket objstore.Bucket, userID string, meta tsdb.BlockMeta) *metadata.DeletionMark

func MockStorageNonCompactionMark

func MockStorageNonCompactionMark(t testing.TB, bucket objstore.Bucket, userID string, meta tsdb.BlockMeta) *metadata.NoCompactMark

func MockStorageParquetConverterMark

func MockStorageParquetConverterMark(t testing.TB, bucket objstore.Bucket, userID string, meta tsdb.BlockMeta, shards int) *parquet.ConverterMark

func PrepareFilesystemBucket

func PrepareFilesystemBucket(t testing.TB) (objstore.InstrumentedBucket, string)

Types

type MockBucketFailure

type MockBucketFailure struct {
	objstore.Bucket

	DeleteFailures []string
	GetFailures    map[string]error
	UploadFailures map[string]error

	UploadCalls atomic.Int32
	GetCalls    atomic.Int32
}

func (*MockBucketFailure) Delete

func (m *MockBucketFailure) Delete(ctx context.Context, name string) error

func (*MockBucketFailure) Get

func (m *MockBucketFailure) Get(ctx context.Context, name string) (io.ReadCloser, error)

func (*MockBucketFailure) GetRange

func (m *MockBucketFailure) GetRange(ctx context.Context, name string, off, length int64) (io.ReadCloser, error)

func (*MockBucketFailure) IsAccessDeniedErr

func (m *MockBucketFailure) IsAccessDeniedErr(err error) bool

func (*MockBucketFailure) ReaderWithExpectedErrs

func (m *MockBucketFailure) ReaderWithExpectedErrs(expectedFunc objstore.IsOpFailureExpectedFunc) objstore.BucketReader

func (*MockBucketFailure) Upload

func (*MockBucketFailure) WithExpectedErrs

func (m *MockBucketFailure) WithExpectedErrs(expectedFunc objstore.IsOpFailureExpectedFunc) objstore.Bucket

Jump to

Keyboard shortcuts

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