type Message struct {
ID string `json:"id"` // message ID Stream string `json:"stream"` // stream to subscribe Body string `json:"body"` // message body in JSON-like text}
Message has header and body, where header contains ID and stream channel name. Body is defined as an interface.
type Receiver struct {
Stream string// stream to receive from LastID string// last ID we have checked Messages chan Message// message queue for receiving Shutdown func() error// function to shutdown the receiver}