Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions rueidiscompat/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ type Cmdable interface {

Watch(ctx context.Context, fn func(Tx) error, keys ...string) error

ForEachMaster(ctx context.Context, fn func(ctx context.Context, client Cmdable) error) error

Client() rueidis.Client
}

Expand Down Expand Up @@ -3293,6 +3295,12 @@ func (c *Compat) ClusterAddSlotsRange(ctx context.Context, min, max int64) *Stat
return newStatusCmd(resp)
}

func (c *Compat) ForEachMaster(ctx context.Context, fn func(ctx context.Context, client Cmdable) error) error {
return c.doPrimaries(ctx, func(client rueidis.Client) error {
return fn(ctx, NewAdapter(client))
})
}

func (c *Compat) GeoAdd(ctx context.Context, key string, geoLocation ...GeoLocation) *IntCmd {
cmd := c.client.B().Geoadd().Key(key).LongitudeLatitudeMember()
for _, loc := range geoLocation {
Expand Down
Loading