event

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CloudController *cloud.Controller
)

Functions

func CheckWorkerTimeout

func CheckWorkerTimeout(event *api.Event)

CheckWorkerTimeout ...

func DeleteEvent

func DeleteEvent(id string) error

DeleteEvent deletes the event. If it is running, delete its worker at the same time.

func GetEvent

func GetEvent(id string) (*api.Event, error)

GetEvent get the event by ID.

func Init

func Init(wopts *cloud.WorkerOptions, cloudAutoDiscovery bool)

Init init event manager Step1: init cloud controller Step2: new event manager Step3: create a goroutine to watch events

func IsEventFinished

func IsEventFinished(event *api.Event) bool

IsEventFinished return true if event is finished.

func UpdateEvent

func UpdateEvent(event *api.Event) error

UpdateEvent updates the event. If it is finished, delete it and trigger the post hook. func (em *eventManager) UpdateEvent(event *api.Event) error {

Types

type EventManager

type EventManager interface {
	HandleEvent(event *api.Event) error
	WatchEvent()
}

EventManager represents the manager of events.

func NewEventManager

func NewEventManager(ds *store.DataStore) EventManager

NewEventManager creates the event manager.

Jump to

Keyboard shortcuts

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