exp: golang.org/x/exp/sumdb/internal/tkv/tkvtest Index | Files

package tkvtest

import "golang.org/x/exp/sumdb/internal/tkv/tkvtest"

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

Index

Package Files

mem.go test.go

func TestStorage Uses

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

type Mem Uses

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 Uses

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 Uses

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

ReadWrite runs f in a read-write transaction.

Package tkvtest imports 8 packages (graph). Updated 2019-08-02. Refresh now. Tools for package owners.