Documentation
¶
Index ¶
- type FakeStorage
- func (f *FakeStorage) Aggregate(table string, query interface{}, result interface{}) error
- func (f *FakeStorage) Close() error
- func (f *FakeStorage) Count(table string, query interface{}) (int, error)
- func (f *FakeStorage) Create(table string, object interface{}) error
- func (f *FakeStorage) CreateMany(collection string, query []interface{}) error
- func (f *FakeStorage) Delete(table string, query interface{}) error
- func (f *FakeStorage) DeleteMany(collection string, query interface{}) error
- func (f *FakeStorage) Find(table string, query interface{}, result interface{}, ...) error
- func (f *FakeStorage) FindOne(table string, query interface{}, result interface{}) error
- func (f FakeStorage) LastChange(table string) interface{}
- func (f FakeStorage) LastQuery(table string) interface{}
- func (f *FakeStorage) NewPaginationParams() *storer.PaginationParams
- func (f *FakeStorage) Update(table string, query interface{}, change interface{}) error
- func (f *FakeStorage) UpdateMany(collection string, query interface{}, change interface{}) error
- func (f *FakeStorage) UpdateWithOptions(table string, query interface{}, change interface{}, options interface{}) error
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 ...