Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBuntDB ¶
CreateBuntDB is called by the CLI tool -create. This removes any existing keys before doing the import.
Types ¶
type ByDistance ¶
type ByDistance struct{ Locations }
ByDistance is a convenience type for sorting locations by their distance.
func (ByDistance) Less ¶
func (s ByDistance) Less(i, j int) bool
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB contains the underlying buntdb for Geo lookups, and in the future may not even be buntdb.
func TryOpenDB ¶
TryOpenDB opens dbFile if it exists, otherwise it reads locationFile. If locationFile also does not exist, a builtin dataset is used.
This complexity is so that the command line server example can be run with no required files or flags.
Caller must call Close() on DB when done.
Click to show internal directories.
Click to hide internal directories.