Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Arguments ¶
type Arguments map[string]interface{}
Arguments is a set of key-value pairs containing arguments specific to a Step
type Document ¶
type Document struct { ContentType string `json:"content_type"` Data string `json:"data"` Encoding Encoding `json:"encoding,omitempty"` // contains filtered or unexported fields }
Document is a payload item containing the payload data, content type, and optional encoding.
func InitDocument ¶
InitDocument starts a blank document with the content type and desired encoding.
func NewDocument ¶
NewDocument creates a new document of string data with content type, and encoding.
func (*Document) Read ¶
Read returns a slice of the Document data verbatim. It does not apply the appropriate; use the Reader().Read() method for this purpose.
func (*Document) Reader ¶
Reader returns an io.Reader for the document data with the appropriate encoding applied
func (*Document) Write ¶
Write appends the provided bytes to the Document data verbatim. It does not apply the appropriate; use the WriteCloser method for this purpose.
func (*Document) WriteCloser ¶
func (d *Document) WriteCloser() (w io.WriteCloser)
WriteCloser returns a stream writer that applies the appropriate encoding. When finished writing, the caller must Close the returned encoder to flush any partially written data.
type ErrorHandling ¶
type ErrorHandling struct { MaxRetries int `json:"max_retries"` Attempt int `json:"attempt,omitempty"` Rewind int `json:"rewind,omitempty"` }
ErrorHandling declares how failed steps are to be handled. Currently focusses on retry limits, and (partially) rewinding the route position.
type Message ¶
type Message struct { Routing `json:"routing"` TraceID string `json:"trace_id"` MetaData `json:"metadata,omitempty"` Documents `json:"documents,omitempty"` }
Message is a simple example message
func MessageFromByteSlice ¶
MessageFromByteSlice unmarshals a JSON byte slice into a Message.
func NewMessage ¶
NewMessage creates a new Message with a unique TraceID, and attaches the routing slip, metadatam and documents.
func NewMessageForRoute ¶
NewMessageForRoute creates a new Message with a unique TraceID to send to the post-office for the route by name.
func (Message) Advance ¶
Advance creates a new Message based on the current message, but with updated documents and advanced routing position. Returns nil if there is no next step.
func (Message) CurrentStep ¶
CurrentStep return the Step at the current position in the routing slip.
type MetaData ¶
type MetaData map[string]interface{}
MetaData is a set of key-value pairs containing general information about a Message