Documentation ¶
Overview ¶
Package operator is an interface for defining arbitrary operators, which gather state and make changes to an environment.
Index ¶
- func ReadState(data *InfoData, stateDir string) (state.State, error)
- func SaveState(data *InfoData, st state.State, stateDir string) error
- type ChangeDetector
- type Command
- type CommandArgFunc
- type Context
- type DesiredStater
- type FS
- type Info
- type InfoData
- type Interface
- type Noop
- type PlanEntry
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChangeDetector ¶
ChangeDetector allows an operator to override the conditions under which a state has changed.
type Command ¶
type Command struct { *cobra.Command ApplyArgs CommandArgFunc Target interface{} }
type CommandArgFunc ¶
type Context ¶
type Context struct { context.Context Opts interface{} FS FS PlanDir opfs.PlanDir Templates *templates.Templates }
func NewContext ¶
func (Context) WithGotState ¶
func (Context) WithSubplan ¶
type DesiredStater ¶
DesiredStater can be implemented by operators to make it possible to skip operator.Run, mark the state unchanged, and still write the resulting state. When this is implemented, the planner will run it before executing the operator, and if the requested state (as determined by DesiredState()) matches the current state, plan application will continue as if the operator was executed.
type PlanEntry ¶
type PlanEntry struct { Name string `json:"name"` Args json.RawMessage `json:"args,omitempty"` }
type Validator ¶
Validator can be implemented by operators to validate arguments before execution. If implemented, Validate can be run multiple times. If evaluated is false, the arguments shell script variables are not expanded -- ie if the argument in the shell script is "$mydir/myfile", that is what the command target args will be on the operation. If true, the arguments shell operators are expanded.
Directories ¶
Path | Synopsis |
---|---|
Package facts manages "facts", which are data gathered from the environment of the agent.
|
Package facts manages "facts", which are data gathered from the environment of the agent. |
Package fileop contains filesystem-related operators.
|
Package fileop contains filesystem-related operators. |
Package gitop contains operators that use git.
|
Package gitop contains operators that use git. |
Package opfs is an fs implementation that supports stat, reads, and globbing.
|
Package opfs is an fs implementation that supports stat, reads, and globbing. |
Package pkgop contains operators for using package managers.
|
Package pkgop contains operators for using package managers. |
Package planop contains a dependency operator and other operations on plans.
|
Package planop contains a dependency operator and other operations on plans. |
Package shellop contains shell operators.
|
Package shellop contains shell operators. |
Package templateop contains template operations.
|
Package templateop contains template operations. |
Package templates contains a template manager.
|
Package templates contains a template manager. |
Package userop contains user operators.
|
Package userop contains user operators. |