Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exchange ¶
type Exchange struct {
// contains filtered or unexported fields
}
func NewExchange ¶
func NewExchange() *Exchange
func (*Exchange) Forward ¶
Forward accepts an envelope to be direcly distributed on the exchange.
This is useful when an event is forwaded on behalf of another namespace or when the event is propagated on behalf of another publisher.
func (*Exchange) Publish ¶
Publish packages and sends an event. The caller will be considered the initial publisher of the event. This means the timestamp will be calculated at this point and this method may read from the calling context.
func (*Exchange) Subscribe ¶
func (e *Exchange) Subscribe(ctx context.Context, fs ...string) (ch <-chan *events.Envelope, errs <-chan error)
Subscribe to events on the exchange. Events are sent through the returned channel ch. If an error is encountered, it will be sent on channel errs and errs will be closed. To end the subscription, cancel the provided context.
Zero or more filters may be provided as strings. Only events that match *any* of the provided filters will be sent on the channel. The filters use the standard containerd filters package syntax.