Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Env ¶ added in v0.9.1
type Env []string
Env is a container for os.Environ style list of combined environment variable strings.
type Event ¶
type Event struct { Type EventType TaskInfo mesosutils.TaskInfo }
Event is a container type for various event specific data.
type EventType ¶
type EventType int
EventType represents task lifecycle event type.
const ( // BeforeTaskStartEvent is an event type that occurs right before task is // started. It is not guaranteed to occur in task lifecycle. BeforeTaskStartEvent EventType = iota // AfterTaskHealthyEvent is an event type that occurs right after first successful // task health check pass. AfterTaskHealthyEvent // BeforeTerminateEvent is an event type that occurs right before task is terminated. // It is guaranteed to occur in task lifecycle and to be last event received. BeforeTerminateEvent )
type Hook ¶
type Hook interface { // HandleEvent is called when any of defined executor task events occurs. // Received events may be handled in any way, but hook should ignore unknown or // unsupported ones. Call to this function will block executor process until // it returns. Order of received event types is undefined. HandleEvent(Event) (Env, error) }
Hook is an interface for various executor extensions, that can add some actions during task lifecycle events.
type Manager ¶
type Manager struct {
Hooks []Hook
}
Manager is a helper type that simplifies calling group of hooks and handling returned errors.
func (*Manager) HandleEvent ¶
HandleEvent calls group of hooks sequentially. It returns error on first hook call error when ignoreErrors argument is false. When ignoreErrors is set to true it will only log errors returned from each hook and will never return an error itself.