fakedb

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeStorage

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

FakeStorage represents fake database object

func NewFakeStorage

func NewFakeStorage(result map[string]interface{}, err error) *FakeStorage

NewFakeStorage creates fake storage db.

func (*FakeStorage) Aggregate

func (f *FakeStorage) Aggregate(table string, query interface{}, result interface{}) error

Aggregate is advenced list method.

func (*FakeStorage) Close

func (f *FakeStorage) Close() error

Close just a method for satisfying storer interface.

func (*FakeStorage) Count

func (f *FakeStorage) Count(table string, query interface{}) (int, error)

Count should return desired object count in ideal form but it always returns zero to test out query generation.

func (*FakeStorage) Create

func (f *FakeStorage) Create(table string, object interface{}) error

Create ...

func (*FakeStorage) CreateMany

func (f *FakeStorage) CreateMany(collection string, query []interface{}) error

func (*FakeStorage) Delete

func (f *FakeStorage) Delete(table string, query interface{}) error

Delete just a method for satisfying storer interface. We are soft-deleting object... Therefore check Update method

func (*FakeStorage) DeleteMany

func (f *FakeStorage) DeleteMany(collection string, query interface{}) error

func (*FakeStorage) Find

func (f *FakeStorage) Find(table string, query interface{}, result interface{}, pagination *storer.PaginationParams) error

Find implements fake database lookup against expected result

func (*FakeStorage) FindOne

func (f *FakeStorage) FindOne(table string, query interface{}, result interface{}) error

FindOne implements fake database lookup against expected result

func (FakeStorage) LastChange

func (f FakeStorage) LastChange(table string) interface{}

LastChange returns last executed change query

func (FakeStorage) LastQuery

func (f FakeStorage) LastQuery(table string) interface{}

LastQuery returns last executed query

func (*FakeStorage) NewPaginationParams

func (f *FakeStorage) NewPaginationParams() *storer.PaginationParams

NewPaginationParams just a method for satisfying storer interface.

func (*FakeStorage) Update

func (f *FakeStorage) Update(table string, query interface{}, change interface{}) error

Update ...

func (*FakeStorage) UpdateMany

func (f *FakeStorage) UpdateMany(collection string, query interface{}, change interface{}) error

func (*FakeStorage) UpdateWithOptions

func (f *FakeStorage) UpdateWithOptions(table string, query interface{}, change interface{}, options interface{}) error

UpdateWithOptions ...

Jump to

Keyboard shortcuts

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