diff --git a/commands.go b/commands.go index 200ec510..bcabbafe 100644 --- a/commands.go +++ b/commands.go @@ -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 +} diff --git a/commands_test.go b/commands_test.go index b6448609..cb8f9452 100644 --- a/commands_test.go +++ b/commands_test.go @@ -1874,6 +1874,12 @@ var _ = Describe("Commands", func() { replace := client.Copy(ctx, "newKey", "key", redisOptions().DB, true) Expect(replace.Val()).To(Equal(int64(1))) }) + + It("should acl dryryn", func() { + dryRun := client.ACLDryRun(ctx, "default", "get", "randomKey") + Expect(dryRun.Err()).NotTo(HaveOccurred()) + Expect(dryRun.Val()).To(Equal("OK")) + }) }) Describe("hashes", func() {