test

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsyncUpdate

func AsyncUpdate(t *testing.T, db dbp.DB)

AsyncUpdate tests that the given database can Update existing metadata in an asynchronous scenario.

func ListKeys

func ListKeys(t *testing.T, db dbp.DB)

ListKeys test the given database in listing the keys it has

func RoundTrip

func RoundTrip(t *testing.T, db dbp.DB)

RoundTrip simply tests test the client's set-get-delete cycle for all kinds of metadata.

func SyncUpdate

func SyncUpdate(t *testing.T, db dbp.DB)

SyncUpdate tests that the given database can Update existing metadata in a synchronous scenario.

Types

type DB

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

DB defines client to store metadata, storing the an in-memory metadata database, used to store encoded metadata directly in an in-memory map.

This implementation is only meant for development and testing purposes, and shouldn't be used for anything serious, given that it will lose all data as soon as it goes out of scope.

func New

func New() *DB

New creates a new in-memory metadata DB, using an nothing but an in-memory map as its storage medium.

This implementation is only meant for development and testing purposes, and shouldn't be used for anything serious, given that it will lose all data as soon as it goes out of scope.

func (*DB) Close

func (db *DB) Close() error

Close implements db.DB

func (*DB) Delete

func (db *DB) Delete(namespace, key []byte) error

Delete implements db.Delete

func (*DB) Get

func (db *DB) Get(namespace, key []byte) ([]byte, error)

Get implements db.Get

func (*DB) ListKeys

func (db *DB) ListKeys(namespace []byte, cb dbp.ListCallback) error

ListKeys implements db.ListKeys

func (*DB) Set

func (db *DB) Set(namespace, key, metadata []byte) error

Set implements db.Set

func (*DB) Update

func (db *DB) Update(namespace, key []byte, cb dbp.UpdateCallback) error

Update implements db.Update

Jump to

Keyboard shortcuts

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