More comments.

This commit is contained in:
Vladimir Mihailenco 2015-05-23 18:17:45 +03:00
parent 7b1eeda9c1
commit b1946ee532
1 changed files with 9 additions and 2 deletions

View File

@ -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,9 +48,13 @@ 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 {
// Can be "subscribe", "unsubscribe", "psubscribe" or "punsubscribe".
Kind string
// Channel name we have subscribed to.
Channel string
// Number of channels we are currently subscribed to.
Count int
}