aboutsummaryrefslogtreecommitdiff
path: root/pkg/commands/subscribe.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/commands/subscribe.go')
-rw-r--r--pkg/commands/subscribe.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg/commands/subscribe.go b/pkg/commands/subscribe.go
new file mode 100644
index 0000000..06dee13
--- /dev/null
+++ b/pkg/commands/subscribe.go
@@ -0,0 +1,13 @@
+package commands
+
+import (
+ "net"
+ "redisClone/pkg/pubsub"
+)
+
+func Subscribe(hub *pubsub.Hub, conn net.Conn, args []string) interface{}{
+ for _, channel := range args[1:]{
+ hub.Subscribe(conn,channel)
+ }
+ return nil
+} \ No newline at end of file