storagetest

package
v0.9.0 Latest Latest
Warning

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

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

Documentation

Overview

Package storagetest provides a shared Ginkgo behavior suite every storage.Adapter implementation must pass. Both shipped adapters register it verbatim, and a new one does the same:

var _ = storagetest.Conformance("postgres", func() storage.Adapter { ... })

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Catalog

func Catalog(name string, newAdapter func() storage.Adapter) bool

Catalog registers the behavior specs for an adapter that implements storage.Catalog. Registered separately from Conformance because the capability is optional; an adapter without one does not call this. newAdapter is called per spec and must return a fresh, empty store; it is closed afterwards.

func Conformance

func Conformance(name string, newAdapter func() storage.Adapter) bool

Conformance registers the adapter behavior specs. newAdapter is called per spec and must return a fresh, empty store; it is closed afterwards.

func CursorState

func CursorState(name string, newAdapter func() storage.Adapter) bool

CursorState registers the behavior specs for an adapter that implements cursorstate.Provider. Registered separately from Conformance because the provider is optional; an adapter without one does not call this. newAdapter is called per spec and must return a fresh, empty store; it is closed afterwards.

func Leases

func Leases(name string, newShared func() (a, b storage.Adapter, cleanup func())) bool

Leases registers the behavior specs for an adapter that implements lease.Provider. Registered separately from Conformance because the provider is optional; an adapter without one does not call this.

newShared returns two adapter handles that share one lease space, plus a cleanup that closes what backs them. For a shared-database adapter that is two opens of the same database — the two-node deployment the leases exist for; for a single-process adapter it is the same store handed back twice, which is the whole sharing that adapter's model permits.

func Replica

func Replica(name string, newAdapter func() storage.Adapter) bool

Replica registers the behavior specs for an adapter that implements storage.ReplicaProvider. Registered separately from Conformance because the capability is optional; an adapter without one does not call this. newAdapter is called per spec and must return a fresh, empty store with a replica configured — pointing the replica at the primary itself is enough, since the specs pin routing and the read contract, not lag. It is closed afterwards.

Types

This section is empty.

Jump to

Keyboard shortcuts

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