Skip to content

Commit 887e913

Browse files
committed
feat: add object fraq command
Signed-off-by: rfyiamcool <[email protected]>
1 parent 73c879d commit 887e913

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

commands_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,9 @@ var _ = Describe("Commands", func() {
675675
Expect(refCount.Err()).NotTo(HaveOccurred())
676676
Expect(refCount.Val()).To(Equal(int64(1)))
677677

678+
freq := client.ObjectFreq(ctx, "key")
679+
Expect(freq.Err()).NotTo(HaveOccurred())
680+
678681
err := client.ObjectEncoding(ctx, "key").Err()
679682
Expect(err).NotTo(HaveOccurred())
680683

generic_commands.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ type GenericCmdable interface {
1919
Keys(ctx context.Context, pattern string) *StringSliceCmd
2020
Migrate(ctx context.Context, host, port, key string, db int, timeout time.Duration) *StatusCmd
2121
Move(ctx context.Context, key string, db int) *BoolCmd
22+
ObjectFreq(ctx context.Context, key string) *IntCmd
2223
ObjectRefCount(ctx context.Context, key string) *IntCmd
2324
ObjectEncoding(ctx context.Context, key string) *StringCmd
2425
ObjectIdleTime(ctx context.Context, key string) *DurationCmd
@@ -159,6 +160,12 @@ func (c cmdable) Move(ctx context.Context, key string, db int) *BoolCmd {
159160
return cmd
160161
}
161162

163+
func (c cmdable) ObjectFreq(ctx context.Context, key string) *IntCmd {
164+
cmd := NewIntCmd(ctx, "object", "freq", key)
165+
_ = c(ctx, cmd)
166+
return cmd
167+
}
168+
162169
func (c cmdable) ObjectRefCount(ctx context.Context, key string) *IntCmd {
163170
cmd := NewIntCmd(ctx, "object", "refcount", key)
164171
_ = c(ctx, cmd)

0 commit comments

Comments
 (0)