Documentation ¶
Overview ¶
Package message provides wrapper structs and helper methods to pipe actual database documents throughout transporter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct { TS int64 NS string Operation ops.Op MapData data.Data // contains filtered or unexported fields }
Base represents a standard message format for transporter data if it does not meet your need, you can embed the struct and override whatever methods needed to accurately represent the data structure.
func (*Base) Confirms ¶ added in v0.4.0
func (m *Base) Confirms() chan struct{}
Confirms provides access to the underlying channel.
func (*Base) Namespace ¶
Namespace returns the combination of database/table/colleciton for the underlying adaptor.
func (*Base) OP ¶
OP returns the type of operation the message is associated with (i.e. insert/update/delete).
func (*Base) Timestamp ¶
Timestamp returns the time the object was created in transporter (i.e. it has no correlation with any time in the database).
func (*Base) UpdateNamespace ¶ added in v0.5.0
UpdateNamespace provides access to change the current namespace associated with the message.
type Msg ¶
type Msg interface { ID() string OP() ops.Op Timestamp() int64 Data() data.Data Namespace() string UpdateNamespace(string) Confirms() chan struct{} }
A Msg serves to wrap the actual document to provide additional metadata about the document being transported.
func WithConfirms ¶ added in v0.4.0
WithConfirms attaches a channel to be able to acknowledge message processing.