Documentation
¶
Index ¶
- type Collection
- type Distributor
- type Event
- type EventMsg
- func (e EventMsg) Await() error
- func (e EventMsg) Complete()
- func (e EventMsg) Fail(err error)
- func (e EventMsg) GetContent() []byte
- func (e EventMsg) GetHeaders() map[string][]string
- func (e EventMsg) GetMessageID() string
- func (e EventMsg) GetURI() string
- func (e EventMsg) ToJSON() (string, error)
- func (e EventMsg) ToJSONb() ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶ added in v0.0.2
type Collection []Event
Collection of events.
func (Collection) Await ¶ added in v0.0.2
func (c Collection) Await() error
Await all events or error.
type Distributor ¶
Distributor will queue an event for distribution, taking care of the messy details.
type Event ¶
type Event interface { GetMessageID() string // GetMessageID returns the message identifier. GetHeaders() map[string][]string // GetHeaders returns HTTP compatible headers. GetURI() string // GetURI returns a HTTP like route. GetContent() []byte // GetContent returns the []byte content of the message. Fail(error) Complete() Await() error }
Event is the most abstract description of the message passing.
type EventMsg ¶
type EventMsg struct { ID string `json:"id"` Headers map[string][]string `json:"headers"` URI string `json:"uri"` Content []byte `json:"content"` FailFunc *func(error) `json:"-"` CompleteFunc *func() `json:"-"` }
EventMsg is the underlying Event.
func (EventMsg) Complete ¶
func (e EventMsg) Complete()
Complete indicates that the given event has successfully been compelted.
func (EventMsg) GetContent ¶
GetContent returns the []byte content of the message.
func (EventMsg) GetHeaders ¶
GetHeaders returns HTTP compatible headers.
func (EventMsg) GetMessageID ¶
GetMessageID returns the message identifier.
Click to show internal directories.
Click to hide internal directories.