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

Add support for acl dryrun command (#2502)

* add support for acl dryrun command

Co-authored-by: Monkey <golang@88.com>
This commit is contained in:
Akshay Gandhi
2023-03-26 19:51:46 +05:30
committed by GitHub
parent 984bc2810d
commit 386e0f0cd3
2 changed files with 17 additions and 0 deletions

View File

@ -452,6 +452,8 @@ type Cmdable interface {
GeoSearchStore(ctx context.Context, key, store string, q *GeoSearchStoreQuery) *IntCmd
GeoDist(ctx context.Context, key string, member1, member2, unit string) *FloatCmd
GeoHash(ctx context.Context, key string, members ...string) *StringSliceCmd
ACLDryRun(ctx context.Context, username string, command ...interface{}) *StringCmd
}
type StatefulCmdable interface {
@ -3757,3 +3759,12 @@ func (c cmdable) GeoPos(ctx context.Context, key string, members ...string) *Geo
_ = c(ctx, cmd)
return cmd
}
func (c cmdable) ACLDryRun(ctx context.Context, username string, command ...interface{}) *StringCmd {
args := make([]interface{}, 0, 3+len(command))
args = append(args, "acl", "dryrun", username)
args = append(args, command...)
cmd := NewStringCmd(ctx, args...)
_ = c(ctx, cmd)
return cmd
}