Documentation ¶
Overview ¶
Package event provides types used to read events from an event bus.
Package event provides types for communicating with various event buses.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReadFunc ¶
type ReadFunc func(ctx context.Context, message json.RawMessage) error
The ReadFunc type is a function that is invoked per-event when using Reader.Read.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
The Reader type is used to read individual events from an event stream.
func NewReader ¶
NewReader returns a new instance of the Reader type, configured to use the event bus described in the URL string.
func (*Reader) Read ¶
Read events from the bus, invoking the ReadFunc for each. This method blocks until the context is cancelled or ReadFunc returns a non-nil error. If the ReadFunc returns a non-nil error, a NACK will be performed on the message where possible before returning. Otherwise, an ACK is performed and the next event is requested.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
The Writer type is used to publish JSON-encoded messages onto an event bus.