Documentation
¶
Index ¶
- type Collection
- func (c *Collection) Bounds() (minX, minY, maxX, maxY float64)
- func (c *Collection) Count() int
- func (c *Collection) Delete(id string) (prev *object.Object)
- func (c *Collection) Get(id string) *object.Object
- func (c *Collection) Intersects(gobj geojson.Object, sparse uint8, cursor Cursor, deadline *deadline.Deadline, ...) bool
- func (c *Collection) Nearby(target geojson.Object, cursor Cursor, deadline *deadline.Deadline, ...) bool
- func (c *Collection) PointCount() int
- func (c *Collection) Scan(desc bool, cursor Cursor, deadline *deadline.Deadline, ...) bool
- func (c *Collection) ScanExpires(iter func(o *object.Object) bool)
- func (c *Collection) ScanGreaterOrEqual(id string, desc bool, cursor Cursor, deadline *deadline.Deadline, ...) bool
- func (c *Collection) ScanRange(start, end string, desc bool, cursor Cursor, deadline *deadline.Deadline, ...) bool
- func (c *Collection) SearchValues(desc bool, cursor Cursor, deadline *deadline.Deadline, ...) bool
- func (c *Collection) SearchValuesRange(start, end string, desc bool, cursor Cursor, deadline *deadline.Deadline, ...) bool
- func (c *Collection) Set(obj *object.Object) (prev *object.Object)
- func (c *Collection) StringCount() int
- func (c *Collection) TotalWeight() int
- func (c *Collection) Within(obj geojson.Object, sparse uint8, cursor Cursor, deadline *deadline.Deadline, ...) bool
- type Cursor
- type String
- func (s String) AppendJSON(dst []byte) []byte
- func (s String) Center() geometry.Point
- func (s String) Contains(obj geojson.Object) bool
- func (s String) Distance(obj geojson.Object) float64
- func (s String) Empty() bool
- func (s String) ForEach(iter func(geom geojson.Object) bool) bool
- func (s String) Intersects(obj geojson.Object) bool
- func (s String) JSON() string
- func (s String) MarshalJSON() ([]byte, error)
- func (s String) Members() string
- func (s String) NumPoints() int
- func (s String) Rect() geometry.Rect
- func (s String) Spatial() geojson.Spatial
- func (s String) String() string
- func (s String) Valid() bool
- func (s String) Within(obj geojson.Object) bool
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 geojson objects.
func (*Collection) Bounds ¶
func (c *Collection) Bounds() (minX, minY, maxX, maxY float64)
Bounds returns the bounds of all the items in the collection.
func (*Collection) Count ¶
func (c *Collection) Count() int
Count returns the number of objects in collection.
func (*Collection) Delete ¶
func (c *Collection) Delete(id string) (prev *object.Object)
Delete removes an object and returns it. If the object does not exist then the 'ok' return value will be false.
func (*Collection) Get ¶
func (c *Collection) Get(id string) *object.Object
Get returns an object. If the object does not exist then the 'ok' return value will be false.
func (*Collection) Intersects ¶
func (c *Collection) Intersects( gobj geojson.Object, sparse uint8, cursor Cursor, deadline *deadline.Deadline, iter func(o *object.Object) bool, ) bool
Intersects returns all object that are intersect an object or bounding box. Set obj to nil in order to use the bounding box.
func (*Collection) Nearby ¶
func (c *Collection) Nearby( target geojson.Object, cursor Cursor, deadline *deadline.Deadline, iter func(o *object.Object, dist float64) bool, ) bool
Nearby returns the nearest neighbors
func (*Collection) PointCount ¶
func (c *Collection) PointCount() int
PointCount returns the number of points (lat/lon coordinates) in collection.
func (*Collection) Scan ¶
func (c *Collection) Scan( desc bool, cursor Cursor, deadline *deadline.Deadline, iterator func(obj *object.Object) bool, ) bool
Scan iterates though the collection ids.
func (*Collection) ScanExpires ¶
func (c *Collection) ScanExpires(iter func(o *object.Object) bool)
ScanExpires returns a list of all objects that have expired.
func (*Collection) ScanGreaterOrEqual ¶
func (c *Collection) ScanGreaterOrEqual(id string, desc bool, cursor Cursor, deadline *deadline.Deadline, iterator func(o *object.Object) bool, ) bool
ScanGreaterOrEqual iterates though the collection starting with specified id.
func (*Collection) ScanRange ¶
func (c *Collection) ScanRange( start, end string, desc bool, cursor Cursor, deadline *deadline.Deadline, iterator func(o *object.Object) bool, ) bool
ScanRange iterates though the collection starting with specified id.
func (*Collection) SearchValues ¶
func (c *Collection) SearchValues( desc bool, cursor Cursor, deadline *deadline.Deadline, iterator func(o *object.Object) bool, ) bool
SearchValues iterates though the collection values.
func (*Collection) SearchValuesRange ¶
func (c *Collection) SearchValuesRange(start, end string, desc bool, cursor Cursor, deadline *deadline.Deadline, iterator func(o *object.Object) bool, ) bool
SearchValuesRange iterates though the collection values.
func (*Collection) Set ¶
func (c *Collection) Set(obj *object.Object) (prev *object.Object)
Set adds or replaces an object in the collection and returns the fields array.
func (*Collection) StringCount ¶
func (c *Collection) StringCount() int
StringCount returns the number of string values.
func (*Collection) TotalWeight ¶
func (c *Collection) TotalWeight() int
TotalWeight calculates the in-memory cost of the collection in bytes.
func (*Collection) Within ¶
func (c *Collection) Within( obj geojson.Object, sparse uint8, cursor Cursor, deadline *deadline.Deadline, iter func(o *object.Object) bool, ) bool
Within returns all object that are fully contained within an object or bounding box. Set obj to nil in order to use the bounding box.