@@ -166,20 +166,6 @@ func (m *Message) String() string {
166
166
return fmt .Sprintf ("Message<%s: %s>" , m .Channel , m .Payload )
167
167
}
168
168
169
- // TODO: remove PMessage if favor of Message
170
-
171
- // Message matching a pattern-matching subscription received as result
172
- // of a PUBLISH command issued by another client.
173
- type PMessage struct {
174
- Channel string
175
- Pattern string
176
- Payload string
177
- }
178
-
179
- func (m * PMessage ) String () string {
180
- return fmt .Sprintf ("PMessage<%s: %s>" , m .Channel , m .Payload )
181
- }
182
-
183
169
// Pong received as result of a PING command issued by another client.
184
170
type Pong struct {
185
171
Payload string
@@ -206,7 +192,7 @@ func (c *PubSub) newMessage(reply []interface{}) (interface{}, error) {
206
192
Payload : reply [2 ].(string ),
207
193
}, nil
208
194
case "pmessage" :
209
- return & PMessage {
195
+ return & Message {
210
196
Pattern : reply [1 ].(string ),
211
197
Channel : reply [2 ].(string ),
212
198
Payload : reply [3 ].(string ),
@@ -244,9 +230,9 @@ func (c *PubSub) ReceiveTimeout(timeout time.Duration) (interface{}, error) {
244
230
return c .newMessage (cmd .Val ())
245
231
}
246
232
247
- // Receive returns a message as a Subscription, Message, PMessage,
248
- // Pong or error. See PubSub example for details. This is low-level
249
- // API and most clients should use ReceiveMessage.
233
+ // Receive returns a message as a Subscription, Message, Pong or error.
234
+ // See PubSub example for details. This is low-level API and most clients
235
+ // should use ReceiveMessage.
250
236
func (c * PubSub ) Receive () (interface {}, error ) {
251
237
return c .ReceiveTimeout (0 )
252
238
}
@@ -290,12 +276,6 @@ func (c *PubSub) ReceiveMessage() (*Message, error) {
290
276
// Ignore.
291
277
case * Message :
292
278
return msg , nil
293
- case * PMessage :
294
- return & Message {
295
- Channel : msg .Channel ,
296
- Pattern : msg .Pattern ,
297
- Payload : msg .Payload ,
298
- }, nil
299
279
default :
300
280
return nil , fmt .Errorf ("redis: unknown message: %T" , msgi )
301
281
}
0 commit comments