Documentation
¶
Index ¶
Constants ¶
View Source
const (
DefaultType string = "grav.default"
)
DefaultType and other represent message consts
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message interface { // Unique ID for this message UUID() string // ID of the parent event or request, such as HTTP request ParentID() string // The UUID of the message being responded to, if any ResponseTo() string // Type of message (application-specific) Type() string // Time the message was emitted Timestamp() time.Time // Raw data of message Data() []byte // Encoded Message object Marshal() ([]byte, error) // Unmarshal encoded Message into object Unmarshal([]byte) error }
Message represents a message
func NewFromBytes ¶ added in v0.0.2
NewFromBytes returns a default _message that has been unmarshalled from bytes. Should only be used if the default _message type is being used.
func NewFromRequest ¶ added in v0.0.2
NewFromRequest extracts an encoded Message from an HTTP request
func NewResponseTo ¶
NewResponseTo creates a new message in response to a previous message
func NewWithParentID ¶
NewWithParentID returns a new message with the provided parent ID
Click to show internal directories.
Click to hide internal directories.