megeo

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: MIT Imports: 3 Imported by: 0

README

megeo

Distance calculation based on Redis-GEO.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GEOItem

type GEOItem struct {
	Longitude float64
	Latitude  float64
	Member    uint64
}

type GEOItems

type GEOItems []*GEOItem

type GEORadiusItem

type GEORadiusItem struct {
	Member   uint64
	Distance float64
}

type GEORadiusItems

type GEORadiusItems []*GEORadiusItem

type MeGEO

type MeGEO struct {
	// contains filtered or unexported fields
}

func NewMeGEO

func NewMeGEO(conn redis.Conn, resource string) *MeGEO

func (*MeGEO) Add

func (geo *MeGEO) Add(item GEOItem) (num int64, err error)

func (*MeGEO) BatchAdd

func (geo *MeGEO) BatchAdd(items GEOItems) (num int64, err error)

func (*MeGEO) Radius

func (geo *MeGEO) Radius(longitude float64, latitude float64, radius uint) (items GEORadiusItems, err error)

Jump to

Keyboard shortcuts

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