This section is empty.


This section is empty.


This section is empty.


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

func (*HookState) Copy

func (h *HookState) Copy() *HookState

Copy HookState. Returns nil if its nil.

func (*HookState) Equal

func (h *HookState) Equal(o *HookState) bool

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.

Source Files