testutil

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: Apache-2.0 Imports: 18 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 added in v1.13.0

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

func PrepareFilesystemBucket added in v1.7.0

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

Types

type MockBucketFailure added in v1.16.0

type MockBucketFailure struct {
	objstore.Bucket

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

	UploadCalls atomic.Int32
	GetCalls    atomic.Int32
}

func (*MockBucketFailure) Delete added in v1.16.0

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

func (*MockBucketFailure) Get added in v1.16.0

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

func (*MockBucketFailure) GetRange added in v1.16.0

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

func (*MockBucketFailure) IsAccessDeniedErr added in v1.16.0

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

func (*MockBucketFailure) ReaderWithExpectedErrs added in v1.16.0

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

func (*MockBucketFailure) Upload added in v1.16.0

func (m *MockBucketFailure) Upload(ctx context.Context, name string, r io.Reader) error

func (*MockBucketFailure) WithExpectedErrs added in v1.16.0

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