Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HookState ¶
type HookState struct { // Prestart is true if the hook has run Prestart successfully and does // not need to run again PrestartDone bool // Data allows hooks to persist arbitrary state. Data map[string]string // Environment variables set by the hook that will continue to be set // even if PrestartDone=true. Env map[string]string }
type LocalState ¶
type LocalState struct { Hooks map[string]*HookState // DriverNetwork is the network information returned by the task // driver's Start method DriverNetwork *drivers.DriverNetwork // TaskHandle is the handle used to reattach to the task during recovery TaskHandle *drivers.TaskHandle }
LocalState is Task state which is persisted for use when restarting Nomad agents.
func NewLocalState ¶
func NewLocalState() *LocalState
func (*LocalState) Canonicalize ¶
func (s *LocalState) Canonicalize()
Canonicalize ensures LocalState is in a consistent state by initializing Hooks and ensuring no HookState's are nil. Useful for cleaning unmarshalled state which may be in an unknown state.
func (*LocalState) Copy ¶
func (s *LocalState) Copy() *LocalState
Copy LocalState. Returns nil if nil.
Click to show internal directories.
Click to hide internal directories.