base

package
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const RemoteStateLinkType = "RemoteStateMarkers"

RemoteStateLinkType - name of markers category for remote states

Variables

This section is empty.

Functions

func DependencyToBashRemoteState

func DependencyToBashRemoteState(dep *project.ULinkT) (remoteStateRef string)

func DependencyToRemoteStateRef

func DependencyToRemoteStateRef(dep *project.ULinkT) (remoteStateRef string)

func StringRemStScanner

func StringRemStScanner(data reflect.Value, unit project.Unit) (reflect.Value, error)

StringRemStScanner scan state data for outputs markers and replaces them for placeholders with remote state ref like <remoteState "stack.unit.output" >

func TerraformJSONParser

func TerraformJSONParser(in string, out *project.UnitLinksT) error

TerraformJSONParser parse in (expected JSON string) and stores it in the value pointed to by out.

Types

type Factory

type Factory struct {
}

Factory factory for s3 backends.

func (*Factory) New

func (f *Factory) New(spec map[string]interface{}, stack *project.Stack) (project.Unit, error)

New creates new unit driver factory.

func (*Factory) NewFromState

func (f *Factory) NewFromState(spec map[string]interface{}, modKey string, p *project.StateProject) (project.Unit, error)

NewFromState creates new unit from state data.

type RequiredProvider

type RequiredProvider struct {
	Source  string `json:"source"`
	Version string `json:"version"`
}

type TerraformTemplateDriver

type TerraformTemplateDriver struct {
}

func (*TerraformTemplateDriver) AddTemplateFunctions

func (d *TerraformTemplateDriver) AddTemplateFunctions(mp template.FuncMap, p *project.Project, s *project.Stack)

func (*TerraformTemplateDriver) Name

func (m *TerraformTemplateDriver) Name() string

type Unit

type Unit struct {
	common.Unit
	// StatePtr          *Unit                       `yaml:"-" json:"-"`
	Providers         interface{}                 `yaml:"-" json:"providers,omitempty"`
	RequiredProviders map[string]RequiredProvider `yaml:"-" json:"required_providers,omitempty"`
	InitDone          bool                        `yaml:"-" json:"-"` // True if unit was initted in this session.

}

Unit describe cluster.dev unit to deploy/destroy terraform modules.

func NewEmptyUnit

func NewEmptyUnit() *Unit

func NewUnit

func NewUnit(spec map[string]interface{}, stack *project.Stack) (*Unit, error)

func (*Unit) AddRequiredProvider

func (u *Unit) AddRequiredProvider(name, source, version string)

func (*Unit) Apply

func (u *Unit) Apply() error

Apply unit.

func (*Unit) Build

func (u *Unit) Build() error

func (*Unit) Destroy

func (u *Unit) Destroy() error

Destroy unit.

func (*Unit) GetDiffData

func (u *Unit) GetDiffData() interface{}

func (*Unit) GetState

func (u *Unit) GetState() project.Unit

func (*Unit) GetStateDiffData

func (u *Unit) GetStateDiffData() interface{}

func (*Unit) GetStateUnit

func (u *Unit) GetStateUnit() *Unit

func (*Unit) GetTemplateDriver

func (u *Unit) GetTemplateDriver() (string, project.TemplateDriver)

GetTemplateDriver return template driver to add template functions into the project.

func (*Unit) GetUnitDiff

func (u *Unit) GetUnitDiff() UnitDiffSpec

func (*Unit) Init

func (u *Unit) Init() error

Init unit.

func (*Unit) LoadState

func (u *Unit) LoadState(spec interface{}, modKey string, p *project.StateProject) error

func (*Unit) Output

func (u *Unit) Output() (string, error)

Output unit. TODO check this method, should be removed

func (*Unit) Plan

func (u *Unit) Plan() error

Plan unit.

func (*Unit) ReadConfig

func (u *Unit) ReadConfig(spec map[string]interface{}, stack *project.Stack) error

func (*Unit) RemoteStatesScanner

func (u *Unit) RemoteStatesScanner(data reflect.Value, unit project.Unit) (reflect.Value, error)

RemoteStatesScanner - project scanner function, witch process dependencies markers in unit data setted by AddRemoteStateMarker template function.

func (*Unit) ReplaceRemoteStatesForDiff

func (u *Unit) ReplaceRemoteStatesForDiff(in, out interface{}) error

ReplaceRemoteStatesForDiff replace remote state markers in struct to <remote state stack.mod.output> to show in diff.

type UnitDiffSpec

type UnitDiffSpec struct {
	// BackendName string      `json:"backend_name"`
	common.UnitDiffSpec
	Providers interface{} `json:"providers,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL