Skip to content

Commit

Permalink
add ACLLogReset to rueidiscompat
Browse files Browse the repository at this point in the history
Signed-off-by: hcc429 <[email protected]>
  • Loading branch information
hcc429 committed Feb 9, 2025
1 parent 93e9af3 commit fcea155
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rueidiscompat/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,8 @@ type CoreCmdable interface {

ACLDryRun(ctx context.Context, username string, command ...any) *StringCmd
// TODO ACLLog(ctx context.Context, count int64) *ACLLogCmd
// TODO ACLLogReset(ctx context.Context) *StatusCmd
ACLLogReset(ctx context.Context) *StatusCmd


ModuleLoadex(ctx context.Context, conf *ModuleLoadexConfig) *StringCmd
GearsCmdable
Expand Down Expand Up @@ -3202,6 +3203,12 @@ func (c *Compat) ACLDryRun(ctx context.Context, username string, command ...any)
return newStringCmd(resp)
}

func (c *Compat) ACLLogReset(ctx context.Context) *StatusCmd {
cmd := c.client.B().AclLog().Reset().Build()
resp := c.client.Do(ctx, cmd)
return newStatusCmd(resp)
}

func (c *Compat) doPrimaries(ctx context.Context, fn func(c rueidis.Client) error) error {
if c.pOnly {
return fn(c.client)
Expand Down
6 changes: 6 additions & 0 deletions rueidiscompat/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -2089,6 +2089,12 @@ func (c *Pipeline) ACLDryRun(ctx context.Context, username string, command ...an
return ret
}

func (c *Pipeline) ACLLogReset(ctx context.Context) *StatusCmd {
ret := c.comp.ACLLogReset(ctx)
c.rets = append(c.rets, ret)
return ret
}

func (c *Pipeline) TFunctionLoad(ctx context.Context, lib string) *StatusCmd {
ret := c.comp.TFunctionLoad(ctx, lib)
c.rets = append(c.rets, ret)
Expand Down

0 comments on commit fcea155

Please sign in to comment.