summaryrefslogtreecommitdiff
path: root/common/pubsub/psmessage.go
blob: e33d9284ade06690fe6ea5a7a72ab009d932c9a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package pubsub

import json "github.com/json-iterator/go"

// Message represents a single message with payload bound to a particular topic
type Message struct {
	// Topic (channel in terms of redis)
	Topic string `json:"topic"`
	// Payload (on some decode stages might be represented as base64 string)
	Payload []byte `json:"payload"`
}

func (m *Message) MarshalBinary() (data []byte, err error) {
	return json.Marshal(m)
}