Documentation ¶
Index ¶
- type ContentType
- type Message
- func (e *Message) WithBody(body []byte) *Message
- func (e *Message) WithContentType(contentType ContentType) *Message
- func (e *Message) WithId(id string) *Message
- func (e *Message) WithSource(source string) *Message
- func (e *Message) WithSpecVersion(version string) *Message
- func (e *Message) WithSubject(subject string) *Message
- func (e *Message) WithTime(t time.Time) *Message
- func (e *Message) WithType(t MessageType) *Message
- type MessageType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentType ¶
type ContentType string
func (ContentType) String ¶
func (c ContentType) String() string
type Message ¶
type Message struct { Id string `json:"id"` Source string `json:"source"` Subject string `json:"subject"` SpecVersion string `json:"specVersion"` ContentType ContentType `json:"contentType"` Error string `json:"error"` Body []byte `json:"body"` Header map[string]string `json:"header"` Type MessageType `json:"type"` Time time.Time `json:"time"` }
* A Message is the payload transmitted over the axon wire, it represents detailed information about the communication, likely followed by the body. In the case of an error, body may be nil. It has the following properties:
Id - the unique identifier for this message ¶
Source - the service this message is coming from Subject - the service's topic this message is coming from
SpecVersion - the version specification of this message ¶
ContentType - the content type of the body []byte so it can be decoded appropriately using the proper encoder/decoder Body - the actual payload for use internal your application Time - when this message was created
func NewMessage ¶
func NewMessage() *Message
func (*Message) WithContentType ¶
func (e *Message) WithContentType(contentType ContentType) *Message
func (*Message) WithSource ¶
func (*Message) WithSpecVersion ¶
func (*Message) WithSubject ¶
func (*Message) WithType ¶
func (e *Message) WithType(t MessageType) *Message
type MessageType ¶
type MessageType int
const ( ErrorMessage MessageType = iota RequestMessage ResponseMessage EventMessage )
func (MessageType) String ¶
func (d MessageType) String() string
Click to show internal directories.
Click to hide internal directories.