type Envelope struct { Timestamp time.Time Namespace string Topic string Event *types.Any }
Envelope provides the packaging for an event.
func (e *Envelope) Field(fieldpath []string) (string, bool)
Field returns the value for the given fieldpath as a string, if defined. If the value is not defined, the second value will be false.
type Event interface{}
Event is a generic interface for any type of event
type Forwarder interface { Forward(ctx context.Context, envelope *Envelope) error }
Forwarder forwards an event to the underlying event bus
type Publisher interface { Publish(ctx context.Context, topic string, event Event) error }
Publisher posts the event.
type Subscriber interface { Subscribe(ctx context.Context, filters ...string) (ch <-chan *Envelope, errs <-chan error) }
Subscriber allows callers to subscribe to events