event

package
v0.7.0-alpha.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckWorkerTimeout

func CheckWorkerTimeout(event *api.Event)

CheckWorkerTimeout ...

func DeleteEventByRecordID added in v0.7.1

func DeleteEventByRecordID(id string) error

DeleteEventByRecordID 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(opts *options.WorkerOptions, notifyURL, recordURLTemplate string)

Init init event manager Step1: new event manager Step2: 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