blobtest

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package blobtest is the contract every blob.Store backend must satisfy. Backends call Run from their own tests; the s3 backend runs it twice, against an in-memory fake everywhere and against MinIO where Docker is available.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Content

func Content(seed byte, n int) []byte

Content returns n deterministic, non-repeating-looking bytes for seed.

func Digest

func Digest(b []byte) blob.Digests

Digest returns all four digests of b, the oracle the suite checks against.

func Put

func Put(ctx context.Context, t *testing.T, s blob.Store, b []byte) blob.Info

Put stores b in one append and returns the committed Info.

func Run

func Run(t *testing.T, newStore func(t *testing.T) blob.Store, o Options)

Run executes the contract. newStore must return an empty store each call.

Types

type Options

type Options struct {
	// LargeSize is the size of the blob used to exercise multi-part paths.
	// Backends that buffer into parts set it above their part size. Zero
	// means 3 MiB.
	LargeSize int
	// FetchPresigned makes the suite GET a signed URL over HTTP and compare
	// the body and the response overrides. Only meaningful against a real
	// object store.
	FetchPresigned bool
}

Options tunes the suite for a backend.

Jump to

Keyboard shortcuts

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