tkvtest

package
v0.0.3-0...-1b97071 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package tkvtest contains a test harness for testing tkv.Storage implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestStorage

func TestStorage(t *testing.T, ctx context.Context, storage tkv.Storage)

Types

type Mem

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

Mem is an in-memory implementation of Storage. It is meant for tests and does not store any data to persistent storage.

The zero value is an empty Mem ready for use.

func (*Mem) ReadOnly

func (m *Mem) ReadOnly(ctx context.Context, f func(context.Context, tkv.Transaction) error) error

ReadOnly runs f in a read-only transaction.

func (*Mem) ReadWrite

func (m *Mem) ReadWrite(ctx context.Context, f func(context.Context, tkv.Transaction) error) error

ReadWrite runs f in a read-write transaction.

Jump to

Keyboard shortcuts

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