Help us shape the future of Go! Take the 2026 Go Developer Survey

conformance

package
v0.26.0 Latest Latest
Warning

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

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

Documentation

Overview

Package conformance provides the reusable black-box contract suite for Ridu document-store adapters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LockedUpdate added in v0.15.0

func LockedUpdate(ctx context.Context, transaction Updater, request store.UpdateRequest) (store.Document, error)

LockedUpdate performs a direct store update the way the operation engine does: it reads the update's document with Request.CurrentRequest and supplies that document as the required Current.

func Run

func Run(t *testing.T, factory Factory)

Run executes the shared semantic contract for one adapter. Adapter packages should invoke Run from their own tests so their ordinary integration setup remains responsible for schema creation and external-service availability.

func RunWriteGuards added in v0.15.0

func RunWriteGuards(t *testing.T, factory Factory)

RunWriteGuards verifies the stored-version guards of the official adapters: an update refuses a Current that no longer describes the stored row, and saving revision 1 starts a document's version history, so a document created with the ID of a removed one never inherits its versions.

Types

type Factory

type Factory func(t *testing.T, manifest schema.Manifest) store.Store

Factory opens a clean store prepared for manifest. Implementations should register cleanup with t and fail the current test when setup cannot finish.

type Updater added in v0.15.0

type Updater interface {
	Find(context.Context, store.Request) (store.Document, error)
	Update(context.Context, store.UpdateRequest) (store.Document, error)
}

Updater is the update surface of a store transaction.

Jump to

Keyboard shortcuts

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