Documentation
¶
Index ¶
- type Collection
- func (c *Collection) Add(obj Object) uint32
- func (c *Collection) Count(where func(where Query)) int
- func (c *Collection) Fetch(index uint32) (Object, bool)
- func (c *Collection) FetchTo(idx uint32, dest *Object) bool
- func (c *Collection) Find(where func(where Query), fn func(Object) bool, props ...string)
- func (c *Collection) Index(name, property string, fn IndexFunc)
- func (c *Collection) Remove(idx uint32)
- type IndexFunc
- type Indexer
- type Mutator
- type Object
- type Query
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
Collection represents a collection of objects in a columnar format
func (*Collection) Add ¶
func (c *Collection) Add(obj Object) uint32
Add adds an object to a collection and returns the allocated index
func (*Collection) Count ¶
func (c *Collection) Count(where func(where Query)) int
Count counts the number of elements which match the specified filter function. If there is no specified filter function, it returns the total count of elements in the collection.
func (*Collection) Fetch ¶
func (c *Collection) Fetch(index uint32) (Object, bool)
Fetch retrieves an object by its handle
func (*Collection) FetchTo ¶
func (c *Collection) FetchTo(idx uint32, dest *Object) bool
FetchTo retrieves an object by its handle into a existing object
func (*Collection) Find ¶
func (c *Collection) Find(where func(where Query), fn func(Object) bool, props ...string)
Find ...
func (*Collection) Index ¶
func (c *Collection) Index(name, property string, fn IndexFunc)
Index creates an index on a specified property
type IndexFunc ¶
type IndexFunc = func(v interface{}) bool
IndexFunc represents a function which can be used to build an index
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query represents a query for a collection
func (Query) With ¶
With applies a logical AND operation to the current query and the specified index.
func (Query) WithFilter ¶
WithFilter applies a filter predicate over values for a specific properties. It filters down the items in the query.
func (Query) WithString ¶
WithString ...