Documentation
¶
Index ¶
- func MatcherFunc(object data.Object) expression.MatcherFunc
- func New() data.Server
- type Collection
- type Iterator
- type Server
- type Session
- func (session Session) Close()
- func (session Session) Delete(collection string, object data.Object, comment string) *derp.Error
- func (session Session) List(collection string, criteria expression.Expression, options ...option.Option) (data.Iterator, *derp.Error)
- func (session Session) Load(collection string, criteria expression.Expression, target data.Object) *derp.Error
- func (session Session) Save(collection string, object data.Object, comment string) *derp.Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MatcherFunc ¶
func MatcherFunc(object data.Object) expression.MatcherFunc
MatcherFunc is a helper function that uses reflection to look inside a generic data.Object and match it. Because it uses reflection, it should be considered SLOW, and only be used in the mock library.
Types ¶
type Collection ¶
Collection is a mock table
func NewCollection ¶ added in v0.3.2
func NewCollection() Collection
NewCollection creates a new collection of data.Objects
func (Collection) FindByObjectID ¶ added in v0.3.2
func (collection Collection) FindByObjectID(objectID string) int
FindByObjectID does a linear search on the collection for the first object with a matching ID()
type Iterator ¶
Iterator represents a generic set of data that can be returned by a datasource.
func NewIterator ¶
NewIterator generates
func (*Iterator) Less ¶
Less reports whether the element with index i should sort before the element with index j. A return value of TRUE means that the item in position "i" should appear ahead of the item in position "j".
func (*Iterator) Next ¶
Next moves the Iterator to the next position in the dataset. If there is another record in the dataset, it returns TRUE, and writes the next record to the "output" variable. If there are no more records, it returns FALSE.
type Session ¶ added in v0.3.2
type Session struct {
Server *Server
}
Session is a mock database session
func (Session) Close ¶ added in v0.3.2
func (session Session) Close()
Close cleans up any remaining data created by the mock session.
func (Session) List ¶ added in v0.3.2
func (session Session) List(collection string, criteria expression.Expression, options ...option.Option) (data.Iterator, *derp.Error)
List retrieves a group of records as an Iterator.
func (Session) Load ¶ added in v0.3.2
func (session Session) Load(collection string, criteria expression.Expression, target data.Object) *derp.Error
Load retrieves a single record from the mock collection.