boltdb

package
v0.0.0-...-46cfdfa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2016 License: MIT Imports: 14 Imported by: 0

Documentation

Index

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 a new geo database, needs a writable path for BoltDB

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 WithDebug

func WithDebug(debug bool) GeoFenceBoltDBOption

WithDebug enable debug

func WithReadOnly

func WithReadOnly(ro bool) GeoFenceBoltDBOption

WithReadOnly enable read only db

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL