From f18210c30e67de4bede7c6080d85629f7086676c Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 10 Jul 2026 20:28:47 +0200 Subject: separated commands into their own files TODO: refactor all commands to work like this --- pkg/commands/set.go | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 pkg/commands/set.go (limited to 'pkg/commands/set.go') diff --git a/pkg/commands/set.go b/pkg/commands/set.go new file mode 100644 index 0000000..19175f1 --- /dev/null +++ b/pkg/commands/set.go @@ -0,0 +1,10 @@ +package commands + +import "redisClone/pkg/core" + +func Set(args []string, getShard func(k string) *core.Shard) interface{} { + key := args[1] + item := core.Item{Value: args[2]} + getShard(key).Data[key] = item + return core.SimpleString("OK") + } \ No newline at end of file -- cgit v1.2.3