Documentation
¶
Index ¶
- Variables
- type Location
- type Namespace
- type QuadTree
- type Stats
- type TreeNode
- type World
- func (m *World) Delete(ns, locId string)
- func (m *World) GetLocation(ns, id string) (Location, bool)
- func (m *World) Merge(w *World)
- func (m *World) QueryRange(ns string, lat1, lat2, lon1, lon2 float64) []*Location
- func (m *World) Save(ns, locId string, lat, lon float64) error
- func (m *World) ToBytes() []byte
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTreeLocationNil = errors.New("insertion failed because location is nil") ErrTreeLocationOutOfBounds = errors.New("insertion failed because location is out of bounds") )
View Source
var ( ErrLocationRequiredId = errors.New("location id is required") ErrLocationInvalidLatitude = errors.New("invalid latitude") ErrLocationInvalidLongitude = errors.New("invalid longitude") ErrLocationRequiredNamespace = errors.New("namespace is required") )
View Source
var (
ErrUnexpectedNilNamespace = errors.New("failed to create namespace")
)
Functions ¶
This section is empty.
Types ¶
type Namespace ¶
type Namespace struct {
Name string
// contains filtered or unexported fields
}
func NewNamespace ¶
func (*Namespace) DeleteLocation ¶
func (*Namespace) QueryRange ¶
type TreeNode ¶
type TreeNode struct {
NE *TreeNode
NW *TreeNode
SE *TreeNode
SW *TreeNode
Lat1 float64
Lat2 float64
Lon1 float64
Lon2 float64
Objects map[string]*Location
Capacity int
IsDivided bool
// contains filtered or unexported fields
}
func NewTreeNode ¶
func (*TreeNode) ForceDivide ¶
func (*TreeNode) QueryRange ¶
type World ¶
type World struct {
// contains filtered or unexported fields
}
func NewWorldFromBytes ¶
func (*World) QueryRange ¶
Click to show internal directories.
Click to hide internal directories.