tracetest

package
v0.2.64 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MPL-2.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tracetest holds what a trace backend proves itself with.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BodyStoreConformance

func BodyStoreConformance(t *testing.T, store trace.BodyStore, key string)

BodyStoreConformance is the one test every BodyStore runs: an in-memory store here, an S3 stub in a backend's tests, and the real object store when its credentials are present. It is the proof that the bytes a spool wrote are the bytes a range reads back, and that each member stands alone.

key is where the test object goes; the caller cleans up.

Types

type MemBodyStore

type MemBodyStore struct {
	// contains filtered or unexported fields
}

MemBodyStore is a BodyStore in memory, for tests.

func (*MemBodyStore) GetBodies

func (m *MemBodyStore) GetBodies(_ context.Context, key string, off, length int64) ([]byte, error)

GetBodies answers a range of a stored object.

func (*MemBodyStore) PutBodies

func (m *MemBodyStore) PutBodies(_ context.Context, key string, r io.ReadSeeker, size int64) error

PutBodies keeps a copy of the bytes.

Jump to

Keyboard shortcuts

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