backendtest

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package backendtest holds the shared conformance suites for backend implementations. Both the in-memory fake (memstore) and the real RcloneStorage run them, so a behavior the fake is trusted to model is the behavior the real backend is required to have. The suites assert only what the interfaces expose, so they work against any implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackendContract added in v0.3.0

func BackendContract(t *testing.T, newStore func(t *testing.T) backend.Backend)

BackendContract runs the object-store conformance suite. newStore must return a fresh, empty store on each call (registering any cleanup via t itself).

func HeaderStoreContract

func HeaderStoreContract(t *testing.T, newStore func(t *testing.T) backend.HeaderStore)

HeaderStoreContract runs the header conformance suite. newStore must return a fresh, empty store on each call (registering any cleanup via t itself). Every store keeps a ".prev" backup (notenv no longer relies on a remote's own version history as a substitute).

func VaultContract added in v0.18.0

func VaultContract(t *testing.T, newStore func(t *testing.T) Vault)

VaultContract asserts the property the Backend and HeaderStore suites miss by running on separate stores: when a header and blobs coexist, List must return only the blobs, never the header artifacts. A backend that leaks the header into List lets whole-vault and orphan-cleanup callers mistake it for a stray object and delete it, bricking the vault. newStore must return a fresh, empty store on each call.

Types

type Vault added in v0.18.0

type Vault interface {
	backend.Backend
	backend.HeaderStore
}

Vault is a backend that holds both objects and the key-slot header in one flat key space, the shape every client-side-crypto backend has.

Jump to

Keyboard shortcuts

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