From 89b3019a3ab77a3e72720342fc0e5bea996fa4f2 Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 12 Jul 2026 13:48:32 +0200 Subject: refactored all functions to use the command registry --- pkg/commands/dbsize.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 pkg/commands/dbsize.go (limited to 'pkg/commands/dbsize.go') diff --git a/pkg/commands/dbsize.go b/pkg/commands/dbsize.go new file mode 100644 index 0000000..dbe39a4 --- /dev/null +++ b/pkg/commands/dbsize.go @@ -0,0 +1,15 @@ +package commands + +import ( + "redisClone/pkg/core" +) + +func Dbsize(args []string, getShard func(k string) *core.Shard) interface{} { + return dbInstance.ExecuteReadAll(func(shards []*core.Shard) interface{} { + count := 0 + for _, shard := range shards { + count += len(shard.Data) + } + return count + }) +} -- cgit v1.2.3