testkit

package
v0.0.0-...-6bc0de5 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const RaceEnabled = false

RaceEnabled is true when the package was compiled with the go race detector enabled.

Not sure of any better way to do it as of writing this.

Variables

This section is empty.

Functions

func NewAcceleratedClock

func NewAcceleratedClock(multiplier int) clockwork.Clock

func NewGCSClient

func NewGCSClient(ctx context.Context, t testing.TB, logging bool) *storage.Client

func NewLogger

func NewLogger(tb testing.TB, opts *slog.HandlerOptions) *slog.Logger

NewLogger creates a new logger that writes to the testing.TB.

func NewSelfAdvanceClock

func NewSelfAdvanceClock(t *testing.T) clockwork.Clock

Types

type StallBackend

type StallBackend struct {
	backend.Backend
	// contains filtered or unexported fields
}

StallBackend is a backend where writes can be paused and resumed.

When a write is stalled, it returns immediately with an error. It will complete asynchronously only when released.

func NewStallBackend

func NewStallBackend(inner backend.Backend) *StallBackend

func (*StallBackend) Delete

func (b *StallBackend) Delete(ctx context.Context, path string) error

func (*StallBackend) DeleteIf

func (b *StallBackend) DeleteIf(
	ctx context.Context,
	path string,
	expected backend.Version,
) error

func (*StallBackend) ReleaseStalled

func (b *StallBackend) ReleaseStalled()

func (*StallBackend) SetTagsIf

func (b *StallBackend) SetTagsIf(
	ctx context.Context,
	path string,
	expected backend.Version,
	t backend.Tags,
) (backend.Metadata, error)

func (*StallBackend) StallWrites

func (b *StallBackend) StallWrites()

func (*StallBackend) StopStalling

func (b *StallBackend) StopStalling()

func (*StallBackend) WaitForStalled

func (b *StallBackend) WaitForStalled()

func (*StallBackend) Write

func (b *StallBackend) Write(
	ctx context.Context,
	path string,
	value []byte,
	t backend.Tags,
) (backend.Metadata, error)

func (*StallBackend) WriteIf

func (b *StallBackend) WriteIf(
	ctx context.Context,
	path string,
	value []byte,
	expected backend.Version,
	t backend.Tags,
) (backend.Metadata, error)

func (*StallBackend) WriteIfNotExists

func (b *StallBackend) WriteIfNotExists(
	ctx context.Context,
	path string,
	value []byte,
	t backend.Tags,
) (backend.Metadata, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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