Documentation
¶
Index ¶
- type CreateFileRepresentation
- type Factory
- type OperationConfig
- type OutputsConfigSpec
- type StateConfigFileSpec
- type StateConfigSpec
- type StateSpec
- type StateSpecDiff
- type Unit
- func (m *Unit) Apply() error
- func (m *Unit) ApplyOutput() []byte
- func (m *Unit) Backend() project.Backend
- func (m *Unit) Build() error
- func (m *Unit) CodeDir() string
- func (m *Unit) CreateCodeDir() error
- func (m *Unit) Dependencies() *[]*project.DependencyOutput
- func (m *Unit) Destroy() error
- func (m *Unit) ExpectedOutputs() map[string]*project.DependencyOutput
- func (m *Unit) FilesList() map[string][]byte
- func (m *Unit) GetDiffData() interface{}
- func (m *Unit) GetState() interface{}
- func (m *Unit) GetStateDiff() StateSpecDiff
- func (m *Unit) Init() error
- func (m *Unit) JSONOutputParser(in string, out interface{}) error
- func (m *Unit) Key() string
- func (m *Unit) KindKey() string
- func (m *Unit) LoadState(spec interface{}, modKey string, p *project.StateProject) error
- func (m *Unit) Markers() map[string]interface{}
- func (m *Unit) Name() string
- func (m *Unit) Plan() error
- func (m *Unit) ProjectPtr() *project.Project
- func (m *Unit) ReadConfig(spec map[string]interface{}, stack *project.Stack) error
- func (m *Unit) RegexOutputParser(in string, out interface{}) error
- func (m *Unit) ReplaceMarkers() error
- func (m *Unit) SeparatorOutputParser(in string, out interface{}) error
- func (m *Unit) StackName() string
- func (m *Unit) StackPtr() *project.Stack
- func (m *Unit) UpdateProjectRuntimeData(p *project.Project) error
- func (m *Unit) WasApplied() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory struct {
}
Factory factory for s3 backends.
func (*Factory) NewFromState ¶
func (f *Factory) NewFromState(spec map[string]interface{}, modKey string, p *project.StateProject) (project.Unit, error)
NewFromState creates new units from state data.
type OperationConfig ¶
type OperationConfig struct {
Commands []interface{} `yaml:"commands" json:"commands"`
}
OperationConfig type that describe apply, plan and destroy operations.
type OutputsConfigSpec ¶
type StateConfigFileSpec ¶
type StateConfigSpec ¶
type StateConfigSpec struct {
SaveFiles []StateConfigFileSpec `yaml:"files"`
SaveApplyCmd bool `yaml:"apply_cmd"`
SaveEnv bool `yaml:"env"`
}
type StateSpec ¶
type StateSpec struct {
WorkDir string `json:"work_dir"`
BackendName string `json:"backend_name"`
Markers map[string]interface{} `json:"markers,omitempty"`
Dependencies []*project.DependencyOutput `json:"dependencies,omitempty"`
CustomStateData map[string]interface{} `json:"custom_state_data,omitempty"`
CreateFiles []CreateFileRepresentation `json:"create_files,omitempty"`
ModType string `json:"type"`
ApplyConf OperationConfig `json:"apply"`
Env map[string]interface{} `json:"env"`
Outputs map[string]*project.DependencyOutput `json:"outputs,omitempty"`
OutputsConfig OutputsConfigSpec `json:"outputs_config,omitempty"`
}
StateSpec the unit's data to
type StateSpecDiff ¶
type StateSpecDiff struct {
Outputs map[string]string `json:"outputs,omitempty"`
CustomStateData map[string]interface{} `json:"custom_state_data,omitempty"`
CreateFiles []CreateFileRepresentation `json:"create_files,omitempty"`
ApplyConf OperationConfig `json:"apply"`
Env map[string]interface{} `json:"env"`
OutputsConfig OutputsConfigSpec `json:"outputs_config,omitempty"`
}
StateSpecDiff describe the pieces of StateSpec data, that will be comered in "plan" diff and should affect the unit redeployment.
type Unit ¶
type Unit struct {
MyName string `yaml:"name"`
WorkDir string `yaml:"work_dir,omitempty"`
Env interface{} `yaml:"env,omitempty"`
CreateFiles []CreateFileRepresentation `yaml:"create_files,omitempty"`
ApplyConf OperationConfig `yaml:"apply"`
PlanConf OperationConfig `yaml:"plan,omitempty"`
DestroyConf OperationConfig `yaml:"destroy"`
GetOutputsConf OutputsConfigSpec `yaml:"outputs,omitempty"`
StateConf StateConfigSpec `yaml:"state,omitempty"`
// contains filtered or unexported fields
}
Unit describe cluster.dev shell unit.
func (*Unit) ApplyOutput ¶
ApplyOutput return output of unit applying.
func (*Unit) CreateCodeDir ¶
CreateCodeDir generate all terraform code for project.
func (*Unit) Dependencies ¶
func (m *Unit) Dependencies() *[]*project.DependencyOutput
Dependencies return slice of unit dependencies.
func (*Unit) ExpectedOutputs ¶
func (m *Unit) ExpectedOutputs() map[string]*project.DependencyOutput
func (*Unit) GetDiffData ¶
func (m *Unit) GetDiffData() interface{}
func (*Unit) GetStateDiff ¶
func (m *Unit) GetStateDiff() StateSpecDiff
func (*Unit) JSONOutputParser ¶
JSONOutputParser parse in (expected JSON string) and stores it in the value pointed to by out.
func (*Unit) LoadState ¶
func (m *Unit) LoadState(spec interface{}, modKey string, p *project.StateProject) error
func (*Unit) ProjectPtr ¶
ProjectPtr return ptr to unit project.
func (*Unit) ReadConfig ¶
func (*Unit) RegexOutputParser ¶
RegexOutputParser parse each line od in string with key/value regexp and stores result as a map in the value pointed to by out.
func (*Unit) ReplaceMarkers ¶
ReplaceMarkers replace all templated markers with values.
func (*Unit) SeparatorOutputParser ¶
SeparatorOutputParser split each line of in string with using separator and stores result as a map in the value pointed to by out.
func (*Unit) UpdateProjectRuntimeData ¶
UpdateProjectRuntimeData update project runtime dataset, adds unit outputs. TODO: get unit outputs and write to project runtime dataset. Now this function is only for printer's unit interface.
func (*Unit) WasApplied ¶
WasApplied return true if unit's method Apply was runned.