1
0
mirror of https://github.com/redis/go-redis.git synced 2025-06-14 01:21:30 +03:00

support geopos command

This commit is contained in:
Sergey Shcherbina
2016-08-22 02:32:06 +05:00
parent 909c26e76c
commit ac1c5e46f9
3 changed files with 97 additions and 0 deletions

View File

@ -234,6 +234,7 @@ type Cmdable interface {
ClusterAddSlots(slots ...int) *StatusCmd
ClusterAddSlotsRange(min, max int) *StatusCmd
GeoAdd(key string, geoLocation ...*GeoLocation) *IntCmd
GeoPos(key string, name ...string) *GeoPosCmd
GeoRadius(key string, longitude, latitude float64, query *GeoRadiusQuery) *GeoLocationCmd
GeoRadiusByMember(key, member string, query *GeoRadiusQuery) *GeoLocationCmd
GeoDist(key string, member1, member2, unit string) *FloatCmd
@ -2054,6 +2055,18 @@ func (c *cmdable) GeoHash(key string, members ...string) *StringSliceCmd {
return cmd
}
func (c *cmdable) GeoPos(key string, names ...string) *GeoPosCmd {
args := make([]interface{}, 2+len(names))
args[0] = "geopos"
args[1] = key
for i, name := range names {
args[2+i] = name
}
cmd := NewGeoPosCmd(args...)
c.process(cmd)
return cmd
}
//------------------------------------------------------------------------------
func (c *cmdable) Command() *CommandsInfoCmd {