aboutsummaryrefslogtreecommitdiff
path: root/pkg/commands/set.go
diff options
context:
space:
mode:
authoralex <[email protected]>2026-07-10 20:28:47 +0200
committeralex <[email protected]>2026-07-10 20:28:47 +0200
commitf18210c30e67de4bede7c6080d85629f7086676c (patch)
treec9aedf21ed9f905424f8ab6fdb633254e127fbc6 /pkg/commands/set.go
parent36d70e64340033f1e5b928524436c0b2f44c831e (diff)
downloadredis-clone-f18210c30e67de4bede7c6080d85629f7086676c.tar.xz
redis-clone-f18210c30e67de4bede7c6080d85629f7086676c.zip
separated commands into their own files TODO: refactor all commands to work like this
Diffstat (limited to 'pkg/commands/set.go')
-rw-r--r--pkg/commands/set.go10
1 files changed, 10 insertions, 0 deletions
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