base

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2025 License: AGPL-3.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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