open-nomad/client/allocrunnerv2/interfaces/runner_lifecycle.go
2018-10-16 16:53:28 -07:00

38 lines
680 B
Go

package interfaces
import (
"github.com/hashicorp/nomad/client/allocrunnerv2/state"
)
// RunnnerHook is a lifecycle hook into the life cycle of an allocation runner.
type RunnerHook interface {
Name() string
}
type RunnerPrerunHook interface {
RunnerHook
Prerun() error
}
type RunnerPostrunHook interface {
RunnerHook
Postrun() error
}
type RunnerDestroyHook interface {
RunnerHook
Destroy() error
}
type RunnerUpdateHook interface {
RunnerHook
Update() error
}
// XXX Not sure yet
type RunnerHookFactory func(target HookTarget) (RunnerHook, error)
type HookTarget interface {
// State retrieves a copy of the target alloc runners state.
State() *state.State
}