events

package
v0.28.4 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 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

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

The difference between Start and StartWithoutCreate is a matter of making this event router more generally usable. The current go-machine-service implementation creates the necessary ExternalHandler upon start up. This router has been refactor to be used in situations where creating an externalHandler is not desired. This allows the router to be used for Agent connections and for ExternalHandlers that are created outside of this router (we want to refactor gms to be that way).

func (*EventRouter) StartWithoutCreate added in v0.19.0

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

func (*EventRouter) Stop

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

type ProcessConfig added in v0.4.0

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