events

package
v1.5.2-1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const EnterState = "enter_state"

Variables

This section is empty.

Functions

func GetEventArgsAsStrings

func GetEventArgsAsStrings(result []string, generic []interface{}) error

func GetRecorder

func GetRecorder() events.EventRecorder

func SetRecorder

func SetRecorder(recorder events.EventRecorder)

func SetRecorderForTest

func SetRecorderForTest(recorder events.EventRecorder)

Types

type ApplicationEvent

type ApplicationEvent interface {
	// an application event is associated with an application Id,
	// dispatcher finds out actual application based on this id
	// to handle this event
	GetApplicationID() string

	// the type of this event
	GetEvent() string

	// an event can have multiple arguments, these arguments will be passed to
	// state machines' callbacks when doing state transition
	GetArgs() []interface{}
}

---------------------------------------------- Application events ----------------------------------------------

type MockedRecorder

type MockedRecorder struct {
	OnEventf func()
}

func NewMockedRecorder

func NewMockedRecorder() *MockedRecorder

func (*MockedRecorder) AnnotatedEventf

func (mr *MockedRecorder) AnnotatedEventf(object runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{})

func (*MockedRecorder) Event

func (mr *MockedRecorder) Event(object runtime.Object, eventtype, reason, message string)

func (*MockedRecorder) Eventf

func (mr *MockedRecorder) Eventf(regarding runtime.Object, related runtime.Object, eventtype, reason, action, note string, args ...interface{})

func (*MockedRecorder) PastEventf

func (mr *MockedRecorder) PastEventf(object runtime.Object, timestamp metav1.Time, eventtype, reason, messageFmt string, args ...interface{})

type SchedulerNodeEvent

type SchedulerNodeEvent interface {
	// returns the node ID
	GetNodeID() string

	// the type of this event
	GetEvent() string

	// an event can have multiple arguments, these arguments will be passed to
	// state machines' callbacks when doing state transition
	GetArgs() []interface{}
}

type SchedulingEvent

type SchedulingEvent interface {
	GetArgs() []interface{}
}

---------------------------------------------- General event interface ----------------------------------------------

type TaskEvent

type TaskEvent interface {
	// application ID which this task belongs to
	GetApplicationID() string

	// a task event must be associated with an application ID
	// and a task ID, dispatcher need them to dispatch this event
	// to the actual task
	GetTaskID() string

	// type of this event
	GetEvent() string

	// an event can have multiple arguments, these arguments will be passed to
	// state machines' callbacks when doing state transition
	GetArgs() []interface{}
}

---------------------------------------------- Task events ----------------------------------------------

Jump to

Keyboard shortcuts

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