From b1946ee532efdd01f4651214002abbf7e740bd99 Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Sat, 23 May 2015 18:17:45 +0300 Subject: [PATCH] More comments. --- pubsub.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pubsub.go b/pubsub.go index 9d63e6be..86e4bf6c 100644 --- a/pubsub.go +++ b/pubsub.go @@ -26,6 +26,7 @@ func (c *Client) Publish(channel, message string) *IntCmd { return req } +// Message received as result of a PUBLISH command issued by another client. type Message struct { Channel string Payload string @@ -35,6 +36,8 @@ func (m *Message) String() string { return fmt.Sprintf("Message<%s: %s>", m.Channel, m.Payload) } +// Message matching a pattern-matching subscription received as result +// of a PUBLISH command issued by another client. type PMessage struct { Channel string Pattern string @@ -45,10 +48,14 @@ func (m *PMessage) String() string { return fmt.Sprintf("PMessage<%s: %s>", m.Channel, m.Payload) } +// Message received after a successful subscription to channel. type Subscription struct { - Kind string + // Can be "subscribe", "unsubscribe", "psubscribe" or "punsubscribe". + Kind string + // Channel name we have subscribed to. Channel string - Count int + // Number of channels we are currently subscribed to. + Count int } func (m *Subscription) String() string {