Documentation ¶
Index ¶
- type GeoFenceBoltDB
- func (gs *GeoFenceBoltDB) FenceByID(loopID uint64) *region.Fence
- func (gs *GeoFenceBoltDB) RadiusQuery(lat, lng, radius float64, opts ...region.QueryOptionsFunc) (region.Fences, error)
- func (gs *GeoFenceBoltDB) RectQuery(urlat, urlng, bllat, bllng float64, opts ...region.QueryOptionsFunc) (region.Fences, error)
- func (gs *GeoFenceBoltDB) StoreFence(fs *geostore.FenceStorage, cover []uint64) error
- func (gs *GeoFenceBoltDB) StubbingQuery(lat, lng float64, opts ...region.QueryOptionsFunc) (region.Fences, error)
- type GeoFenceBoltDBOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GeoFenceBoltDB ¶
type GeoFenceBoltDB struct { augmentedtree.Tree *bolt.DB // contains filtered or unexported fields }
GeoFenceBoltDB provides an in memory index and boltdb query engine for fences lookup
func NewGeoFenceBoltDB ¶
func NewGeoFenceBoltDB(dbpath string, opts ...GeoFenceBoltDBOption) (*GeoFenceBoltDB, error)
NewGeoFenceBoltDB creates or reopen a bolt geo database
func NewGeoFenceIdx ¶
func NewGeoFenceIdx(db *bolt.DB, opts ...GeoFenceBoltDBOption) (*GeoFenceBoltDB, error)
NewGeoFenceIdx a geo index over a BoltDB storage
func (*GeoFenceBoltDB) FenceByID ¶
func (gs *GeoFenceBoltDB) FenceByID(loopID uint64) *region.Fence
FenceByID returns a region from DB by its id
func (*GeoFenceBoltDB) RadiusQuery ¶
func (gs *GeoFenceBoltDB) RadiusQuery(lat, lng, radius float64, opts ...region.QueryOptionsFunc) (region.Fences, error)
RadiusQuery is performing a radius query
func (*GeoFenceBoltDB) RectQuery ¶
func (gs *GeoFenceBoltDB) RectQuery(urlat, urlng, bllat, bllng float64, opts ...region.QueryOptionsFunc) (region.Fences, error)
RectQuery perform rectangular query ur upper right bl bottom left
func (*GeoFenceBoltDB) StoreFence ¶
func (gs *GeoFenceBoltDB) StoreFence(fs *geostore.FenceStorage, cover []uint64) error
StoreFence stores a fence into the database and load its index in memory
func (*GeoFenceBoltDB) StubbingQuery ¶
func (gs *GeoFenceBoltDB) StubbingQuery(lat, lng float64, opts ...region.QueryOptionsFunc) (region.Fences, error)
StubbingQuery returns the fence for the corresponding lat, lng point
type GeoFenceBoltDBOption ¶
type GeoFenceBoltDBOption func(*geoFenceBoltDBOptions)
GeoSearchOption used to pass options to NewGeoSearch
func WithCachedEntries ¶
func WithCachedEntries(maxCachedEntries uint) GeoFenceBoltDBOption
WithCachedEntries enable an LRU cache default is disabled
func WithCoverBucket ¶
func WithCoverBucket(coverBucket string) GeoFenceBoltDBOption
WithCoverBucket set the cover bucket name
func WithLoopBucket ¶
func WithLoopBucket(loopBucket string) GeoFenceBoltDBOption
WithLoopBucket set the loop bucket name
func WithReadOnly ¶
func WithReadOnly(ro bool) GeoFenceBoltDBOption
WithReadOnly enable read only db