events

package
v1.0.0-alpha2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2017 License: Apache-2.0, CC-BY-SA-4.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event interface{}

type Exchange

type Exchange struct {
	// contains filtered or unexported fields
}

func NewExchange

func NewExchange() *Exchange

func (*Exchange) Forward

func (e *Exchange) Forward(ctx context.Context, envelope *events.Envelope) error

Forward accepts an envelope to be direcly distributed on the exchange.

func (*Exchange) Publish

func (e *Exchange) Publish(ctx context.Context, topic string, event Event) error

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, filters ...filters.Filter) (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.

type Forwarder

type Forwarder interface {
	Forward(ctx context.Context, envelope *events.Envelope) error
}

type Publisher

type Publisher interface {
	Publish(ctx context.Context, topic string, event Event) error
}

Publisher posts the event.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL