memory

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() data.Datastore

New returns a fully initialized Database object

Types

type Collection

type Collection map[string]data.Object

Collection is a mock table

type Datastore

type Datastore map[string]Collection

Datastore is a mock database

func (*Datastore) Close added in v0.2.1

func (db *Datastore) Close()

Close cleans up any remaining data created by the mock session.

func (*Datastore) Delete

func (db *Datastore) Delete(collection string, object data.Object, comment string) *derp.Error

Delete PERMANENTLY removes a record from the mock database.

func (*Datastore) Load

func (db *Datastore) Load(collection string, filter data.Expression, target data.Object) *derp.Error

Load retrieves a single record from the mock collection.

func (*Datastore) Save

func (db *Datastore) Save(collection string, object data.Object, comment string) *derp.Error

Save adds/inserts a new record into the mock database

func (*Datastore) Session

func (db *Datastore) Session(ctx context.Context) data.Session

Session returns a session that can be used as a mock database.

Jump to

Keyboard shortcuts

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