Documentation ¶
Overview ¶
Package state contains the type that maintain the state during a run.
Index ¶
- type State
- func (st *State) GetDetached() []string
- func (st *State) GetEnv() []string
- func (st *State) GetRunning() []string
- func (st *State) MapSlice(slice, fullEnv []string) ([]string, error)
- func (st *State) MarkDetached(name string)
- func (st *State) MarkRunning(name string)
- func (st *State) MergeEnv(env []string)
- func (st *State) UnmarkRunning(name string)
- func (st *State) Valid() error
- func (st *State) WrapWithExpandableEnv(env, expandable []string, delimiter string) *State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type State ¶
type State struct { CfgPath string CleanupList *cleanup.List Network network.Network Workspace workspace.Workspace KeepWorkspace bool DisableDeprecated bool ForceSequential bool EnableSSHAgent bool PlanTimeout time.Duration DockerConfig string Memory string // contains filtered or unexported fields }
State holds all of the runtime data during a run.
func (*State) GetDetached ¶ added in v0.10.2
GetDetached returns a list of all detached containers.
func (*State) GetEnv ¶ added in v0.11.0
GetEnv gets the fullEnv with the wrapped environments applied.
func (*State) GetRunning ¶ added in v0.11.0
GetRunning returns a list of all running containers.
func (*State) MapSlice ¶ added in v0.10.0
MapSlice calls SliceMapper on the given environment, but also checks to see if the variable in the env parameter can be expanded into a list.
func (*State) MarkDetached ¶ added in v0.10.2
MarkDetached will add the given container name into the list of containers running in detached mode which must be shut down at the end of the plan. This falls through directly to the root state so that states wrapping the global one do not have to sync additional detached container names.
func (*State) MarkRunning ¶ added in v0.11.0
MarkRunning will add the given container name into the list of containers currently running. This falls through directly to the root state so that states wrapping the global one do not have to sync additional running container names.
func (*State) MergeEnv ¶ added in v0.11.0
MergeEnv adds additional environment arguments with lower precedence to the original state environment. If they duplicate an existing environment variable, that value will be unchanged.
func (*State) UnmarkRunning ¶ added in v0.11.0
UnmarkRunning removes a container from the list of running containers.
func (*State) WrapWithExpandableEnv ¶ added in v0.10.2
WrapWithExpandableEnv will create a shallow clone of the state with a reference to the current state as "parent" with a modified environment. This creates a local stack of states which do not interfere with other goroutines. A pop operation is the same as ignoring the wrapped values and using the underlying state. This stack is used to map a slice within an extended task.