···129129 return fmt.Errorf("received status %s - %s", resp, buf)
130130}
131131132132-// Consumer allows the consumption of messages. It is thread safe to range over the Msgs channel to consume. If during the consumer
133133-// receiving messages from the server an error occurs, it will be stored in Err
132132+// Consumer allows the consumption of messages. If during the consumer receiving messages from the
133133+// server an error occurs, it will be stored in Err
134134type Consumer struct {
135135 msgs chan messagebroker.Message
136136 // TODO: better error handling? Maybe a channel of errors?
137137 Err error
138138}
139139140140+// Messages returns a channel in which this consumer will put messages onto. It is safe to range over the channel since it will be closed once
141141+// the consumer has finished either due to an error or from being cancelled.
140142func (c *Consumer) Messages() <-chan messagebroker.Message {
141143 return c.msgs
142144}