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/ping.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 pkg/commands/ping.go (limited to 'pkg/commands/ping.go') diff --git a/pkg/commands/ping.go b/pkg/commands/ping.go new file mode 100644 index 0000000..b56cd20 --- /dev/null +++ b/pkg/commands/ping.go @@ -0,0 +1,16 @@ +package commands + +import ( + "errors" + "redisClone/pkg/core" +) + +func Ping(args []string, getShard func(k string) *core.Shard) interface{} { + if len(args) == 1 { + return core.SimpleString("PONG") + } + if len(args) == 2 { + return args[1] + } + return errors.New("wrong number of arguments for 'PING' command") +} -- cgit v1.2.3