aboutsummaryrefslogtreecommitdiff
path: root/pkg/commands/multi.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/commands/multi.go')
-rw-r--r--pkg/commands/multi.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/pkg/commands/multi.go b/pkg/commands/multi.go
new file mode 100644
index 0000000..2b0fcb7
--- /dev/null
+++ b/pkg/commands/multi.go
@@ -0,0 +1,18 @@
+package commands
+
+import (
+ "errors"
+ "net"
+ "redisClone/pkg/core"
+)
+
+func Multi(db core.RedisDB, session *ClientSession, conn net.Conn, execArgs []string) interface{} {
+ if session.InTransaction {
+ return errors.New("MULTI calls can not be nested")
+ }
+ session.InTransaction = true
+
+ session.Queue = make([][]string, 0)
+
+ return core.SimpleString("OK")
+} \ No newline at end of file