event_bus

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2017 License: Apache-2.0 Imports: 11 Imported by: 63

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventBus

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

func New

func New() *EventBus

*

  • Construct a new EventBus

func (*EventBus) Publish

func (ebus *EventBus) Publish(event interface{}) error

*

  • Publish an event to the EventBus

func (*EventBus) Register

func (ebus *EventBus) Register(fn interface{}, forTypes ...interface{})

*

  • Register an event handler

type Handlers

type Handlers struct {
	Conf    *configuration.Configuration
	Storage service.Storage
}

func (*Handlers) MarathonEventHandler

func (h *Handlers) MarathonEventHandler(event MarathonEvent)

func (*Handlers) ServiceEventHandler

func (h *Handlers) ServiceEventHandler(event ServiceEvent)

type MarathonEvent

type MarathonEvent struct {
	// EventType can be
	// api_post_event, status_update_event, subscribe_event
	EventType string
	Timestamp string
}

type ServiceEvent

type ServiceEvent struct {
	EventType string
}

type ZookeeperEvent

type ZookeeperEvent struct {
	Source    string
	EventType string
}

Jump to

Keyboard shortcuts

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