module

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const InitTask task.Identifier = "init"

Variables

This section is empty.

Functions

func ByPath

func ByPath(i, j *Module) int

Types

type Module

type Module struct {
	resource.ID

	// Path relative to pug working directory
	Path string
	// The module's current workspace.
	CurrentWorkspaceID *resource.ID

	// The module's backend type
	Backend string
	// contains filtered or unexported fields
}

Module is a terraform root module.

func New

func New(opts Options) *Module

New constructs a module.

func (*Module) Dependencies added in v0.5.2

func (m *Module) Dependencies() []resource.ID

func (*Module) LogValue

func (m *Module) LogValue() slog.Value

func (*Module) String added in v0.2.0

func (m *Module) String() string

type Options added in v0.3.3

type Options struct {
	// Path is the module path relative to the working directory.
	Path string
	// Backend is the type of terraform backend
	Backend string
}

Options for constructing a module.

type Service

type Service struct {
	*pubsub.Broker[*Module]
	// contains filtered or unexported fields
}

func NewService

func NewService(opts ServiceOptions) *Service

func (*Service) Execute added in v0.5.2

func (s *Service) Execute(moduleID resource.ID, program string, args ...string) (task.Spec, error)

Execute a program in a module's directory.

func (*Service) Format

func (s *Service) Format(moduleID resource.ID) (task.Spec, error)

func (*Service) Get

func (s *Service) Get(id resource.ID) (*Module, error)

func (*Service) GetByPath

func (s *Service) GetByPath(path string) (*Module, error)

func (*Service) Init

func (s *Service) Init(moduleID resource.ID, upgrade bool) (task.Spec, error)

Init invokes terraform init on the module.

func (*Service) List

func (s *Service) List() []*Module

func (*Service) Reload

func (s *Service) Reload() (added []string, removed []string, err error)

Reload searches the working directory recursively for modules and adds them to the store before pruning those that are currently stored but can no longer be found.

TODO: separate into Load and Reload

func (*Service) SetCurrent

func (s *Service) SetCurrent(moduleID, workspaceID resource.ID) error

SetCurrent sets the current workspace for the module.

func (*Service) Validate

func (s *Service) Validate(moduleID resource.ID) (task.Spec, error)

type ServiceOptions

type ServiceOptions struct {
	Tasks       *task.Service
	Workdir     internal.Workdir
	PluginCache bool
	Logger      logging.Interface
	Terragrunt  bool
}

Jump to

Keyboard shortcuts

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