boltdb

package
v0.0.0-...-5a250f9 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2018 License: MIT Imports: 14 Imported by: 3

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 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 WithDebug

func WithDebug(debug bool) GeoFenceBoltDBOption

WithDebug enable debug

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

Jump to

Keyboard shortcuts

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