stack

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseStack

type BaseStack struct {
	// contains filtered or unexported fields
}

BaseStack is a struct that implements the Stack interface.

func NewBaseStack

func NewBaseStack(injector di.Injector) *BaseStack

NewBaseStack creates a new base stack of components.

func (*BaseStack) Down added in v0.6.0

func (s *BaseStack) Down() error

Down destroys a stack of components.

func (*BaseStack) Initialize

func (s *BaseStack) Initialize() error

Initialize initializes the stack of components.

func (*BaseStack) Up

func (s *BaseStack) Up() error

Up creates a new stack of components.

type MockStack

type MockStack struct {
	InitializeFunc func() error
	UpFunc         func() error
	DownFunc       func() error
}

MockStack is a mock implementation of the Stack interface for testing.

func NewMockStack

func NewMockStack(injector di.Injector) *MockStack

NewMockStack creates a new mock stack.

func (*MockStack) Down added in v0.6.0

func (m *MockStack) Down() error

Down is a mock implementation of the Down method.

func (*MockStack) Initialize

func (m *MockStack) Initialize() error

Initialize is a mock implementation of the Initialize method.

func (*MockStack) Up

func (m *MockStack) Up() error

Up is a mock implementation of the Up method.

type Shims added in v0.5.7

type Shims struct {
	Stat     func(string) (os.FileInfo, error)
	Chdir    func(string) error
	Getwd    func() (string, error)
	Setenv   func(string, string) error
	Unsetenv func(string) error
	Remove   func(string) error
}

Shims provides mockable wrappers around system and runtime functions

func NewShims added in v0.5.7

func NewShims() *Shims

NewShims creates a new Shims instance with default implementations

type Stack

type Stack interface {
	Initialize() error
	Up() error
	Down() error
}

Stack is an interface that represents a stack of components.

type WindsorStack

type WindsorStack struct {
	BaseStack
	// contains filtered or unexported fields
}

WindsorStack is a struct that implements the Stack interface.

func NewWindsorStack

func NewWindsorStack(injector di.Injector) *WindsorStack

NewWindsorStack creates a new WindsorStack.

func (*WindsorStack) Down added in v0.6.0

func (s *WindsorStack) Down() error

Down destroys all Terraform components in the stack by executing Terraform destroy operations in reverse dependency order. For each component, Down generates Terraform arguments, sets required environment variables, unsets conflicting TF_CLI_ARGS_* variables, creates backend override files, runs Terraform refresh, plan (with destroy flag), and destroy commands, and removes backend override files. Components with Destroy set to false are skipped. Directory state is restored after execution. Errors are returned on any operation failure.

func (*WindsorStack) Initialize added in v0.7.0

func (s *WindsorStack) Initialize() error

Initialize initializes the WindsorStack by calling the base Initialize and resolving terraform environment.

func (*WindsorStack) Up

func (s *WindsorStack) Up() error

Up creates a new stack of components by initializing and applying Terraform configurations. It processes components in order, generating terraform arguments, running Terraform init, plan, and apply operations, and cleaning up backend override files. The method ensures proper directory management and terraform argument setup for each component.

Jump to

Keyboard shortcuts

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