events

package
v0.0.0-...-9e3e9a5 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const MaxWait = time.Duration(time.Second * 10)

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Name                         string
	ID                           string
	PreviousIds                  string
	PreviousNames                string
	Publisher                    string
	ReplyTo                      string
	ResourceID                   string
	ResourceType                 string
	Transitioning                string
	TransitioningInternalMessage string
	TransitioningMessage         string
	TransitioningProgress        string
	Data                         map[string]interface{}
}

type EventHandler

type EventHandler func(*Event, *client.RancherClient) error

EventHandler Defines the function "interface" that handlers must conform to.

type EventRouter

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

func NewEventRouter

func NewEventRouter(name string, priority int, apiURL string, accessKey string, secretKey string,
	apiClient *client.RancherClient, eventHandlers map[string]EventHandler, resourceName string, workerCount int) (*EventRouter, error)

func (*EventRouter) Start

func (router *EventRouter) Start(ready chan<- bool) error

func (*EventRouter) StartWithoutCreate

func (router *EventRouter) StartWithoutCreate(ready chan<- bool) error

func (*EventRouter) Stop

func (router *EventRouter) Stop() (err error)

type ProcessConfig

type ProcessConfig struct {
	Name    string `json:"name"`
	OnError string `json:"onError"`
}

type ReplyEvent

type ReplyEvent struct {
	Name        string                 `json:"name"`
	PreviousIds []string               `json:"previousIds"`
	Data        map[string]interface{} `json:"data"`
}

func NewReplyEvent

func NewReplyEvent(replyTo string, eventID string) *ReplyEvent

type Worker

type Worker struct {
}

func (*Worker) DoWork

func (w *Worker) DoWork(rawEvent []byte, eventHandlers map[string]EventHandler, apiClient *client.RancherClient,
	workers chan *Worker)

Jump to

Keyboard shortcuts

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