gcp

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCouldNotMarshalEvent = errors.New("could not marshal event")

ErrCouldNotMarshalEvent is when an event could not be marshaled into BSON.

View Source
var ErrCouldNotUnmarshalEvent = errors.New("could not unmarshal event")

ErrCouldNotUnmarshalEvent is when an event could not be unmarshaled into a concrete type.

Functions

This section is empty.

Types

type Error

type Error struct {
	Err   error
	Ctx   context.Context
	Event eh.Event
}

Error is an async error containing the error and the event.

func (Error) Error

func (e Error) Error() string

Error implements the Error method of the error interface.

type EventPublisher

type EventPublisher struct {
	*local.EventPublisher
	// contains filtered or unexported fields
}

EventPublisher is an event bus that notifies registered EventHandlers of published events. It will use the SimpleEventHandlingStrategy by default.

func NewEventPublisher

func NewEventPublisher(projectID, appID string) (*EventPublisher, error)

NewEventPublisher creates a EventPublisher.

func (*EventPublisher) Close

func (b *EventPublisher) Close() error

Close exits the receive goroutine by unsubscribing to all channels.

func (*EventPublisher) Errors

func (b *EventPublisher) Errors() <-chan Error

Errors returns an error channel where async handling errors are sent.

func (*EventPublisher) HandleEvent

func (b *EventPublisher) HandleEvent(ctx context.Context, event eh.Event) error

HandleEvent implements the HandleEvent method of the eventhorizon.EventPublisher interface.

Jump to

Keyboard shortcuts

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