Skip to content
Merged
Show file tree
Hide file tree
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
15 changes: 15 additions & 0 deletions rueidiscompat/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ type CoreCmdable interface {
ACLDelUser(ctx context.Context, username string) *IntCmd
ACLLogReset(ctx context.Context) *StatusCmd
ACLCat(ctx context.Context) *StringSliceCmd
ACLCatArgs(ctx context.Context, options *ACLCatArgs) *StringSliceCmd

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

type ACLCatArgs struct {
Category string
}

func (c *Compat) ACLCatArgs(ctx context.Context, options *ACLCatArgs) *StringSliceCmd {
// if there is a category passed, build new cmd, if there isn't - use the ACLCat method
if options != nil && options.Category != "" {
cmd := c.client.B().AclCat().Categoryname(options.Category).Build()
resp := c.client.Do(ctx, cmd)
return newStringSliceCmd(resp)
}
return c.ACLCat(ctx)
}

func (c *Compat) ACLLog(ctx context.Context, count int64) *ACLLogCmd {
cmd := c.client.B().AclLog().Count(count).Build()
resp := c.client.Do(ctx, cmd)
Expand Down
6 changes: 6 additions & 0 deletions rueidiscompat/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -2125,6 +2125,12 @@ func (c *Pipeline) ACLCat(ctx context.Context) *StringSliceCmd {
return ret
}

func (c *Pipeline) ACLCatArgs(ctx context.Context, options *ACLCatArgs) *StringSliceCmd {
ret := c.comp.ACLCatArgs(ctx, options)
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