mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
Add Geo commands read-only variants
This commit is contained in:
14
commands.go
14
commands.go
@ -234,7 +234,9 @@ type Cmdable interface {
|
||||
GeoAdd(key string, geoLocation ...*GeoLocation) *IntCmd
|
||||
GeoPos(key string, members ...string) *GeoPosCmd
|
||||
GeoRadius(key string, longitude, latitude float64, query *GeoRadiusQuery) *GeoLocationCmd
|
||||
GeoRadiusRO(key string, longitude, latitude float64, query *GeoRadiusQuery) *GeoLocationCmd
|
||||
GeoRadiusByMember(key, member string, query *GeoRadiusQuery) *GeoLocationCmd
|
||||
GeoRadiusByMemberRO(key, member string, query *GeoRadiusQuery) *GeoLocationCmd
|
||||
GeoDist(key string, member1, member2, unit string) *FloatCmd
|
||||
GeoHash(key string, members ...string) *StringSliceCmd
|
||||
Command() *CommandsInfoCmd
|
||||
@ -2061,12 +2063,24 @@ func (c *cmdable) GeoRadius(key string, longitude, latitude float64, query *GeoR
|
||||
return cmd
|
||||
}
|
||||
|
||||
func (c *cmdable) GeoRadiusRO(key string, longitude, latitude float64, query *GeoRadiusQuery) *GeoLocationCmd {
|
||||
cmd := NewGeoLocationCmd(query, "georadius_ro", key, longitude, latitude)
|
||||
c.process(cmd)
|
||||
return cmd
|
||||
}
|
||||
|
||||
func (c *cmdable) GeoRadiusByMember(key, member string, query *GeoRadiusQuery) *GeoLocationCmd {
|
||||
cmd := NewGeoLocationCmd(query, "georadiusbymember", key, member)
|
||||
c.process(cmd)
|
||||
return cmd
|
||||
}
|
||||
|
||||
func (c *cmdable) GeoRadiusByMemberRO(key, member string, query *GeoRadiusQuery) *GeoLocationCmd {
|
||||
cmd := NewGeoLocationCmd(query, "georadiusbymember_ro", key, member)
|
||||
c.process(cmd)
|
||||
return cmd
|
||||
}
|
||||
|
||||
func (c *cmdable) GeoDist(key string, member1, member2, unit string) *FloatCmd {
|
||||
if unit == "" {
|
||||
unit = "km"
|
||||
|
Reference in New Issue
Block a user