events

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2018 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Envelope

type Envelope struct {
	Timestamp time.Time
	Namespace string
	Topic     string
	Event     *types.Any
}

Envelope provides the packaging for an event.

func (*Envelope) Field

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

type Event interface{}

Event is a generic interface for any type of event

type Forwarder

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

Forwarder forwards an event to the underlying event bus

type Publisher

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

Publisher posts the event.

type Subscriber

type Subscriber interface {
	Subscribe(ctx context.Context, filters ...string) (ch <-chan *Envelope, errs <-chan error)
}

Subscriber allows callers to subscribe to events

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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