Skip to content

Commit

Permalink
feat: add ACLCat to rueidiscompat (#748)
Browse files Browse the repository at this point in the history
* feat(issue-742): add ACLCat to rueidiscompat

Signed-off-by: astorig <[email protected]>

* feat(issue-742): add ACLCat to CoreCmdable interface

Signed-off-by: astorig <[email protected]>

---------

Signed-off-by: astorig <[email protected]>
Co-authored-by: Rueian <[email protected]>
  • Loading branch information
astorig and rueian authored Feb 12, 2025
1 parent 98c2e01 commit e11af53
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rueidiscompat/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ type CoreCmdable interface {
ACLSetUser(ctx context.Context, username string, rules ...string) *StatusCmd
ACLDelUser(ctx context.Context, username string) *IntCmd
ACLLogReset(ctx context.Context) *StatusCmd
ACLCat(ctx context.Context) *StringSliceCmd

ModuleLoadex(ctx context.Context, conf *ModuleLoadexConfig) *StringCmd
GearsCmdable
Expand Down Expand Up @@ -3215,12 +3216,19 @@ func (c *Compat) ACLSetUser(ctx context.Context, username string, rules ...strin
resp := c.client.Do(ctx, cmd)
return newStatusCmd(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) ACLCat(ctx context.Context) *StringSliceCmd {
cmd := c.client.B().AclCat().Build()
resp := c.client.Do(ctx, cmd)
return newStringSliceCmd(resp)
}

func (c *Compat) ACLDelUser(ctx context.Context, username string) *IntCmd {
cmd := c.client.B().AclDeluser().Username(username).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 @@ -2113,6 +2113,12 @@ func (c *Pipeline) ACLLogReset(ctx context.Context) *StatusCmd {
return ret
}

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

Please sign in to comment.