Thanks to visit codestin.com
Credit goes to pkg.go.dev

x

package
v2.29.3 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ReadmeFile is the location we look for to extract documentation from template versions.
	ReadmeFile = "README.md"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Layout

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

func EphemeralSessionDir

func EphemeralSessionDir(parentDir, sessID string) Layout

EphemeralSessionDir returns the directory name with mandatory prefix. These directories are created for each provisioning session and are meant to be ephemeral.

func SessionDir

func SessionDir(parentDir, sessID string, config *proto.Config) Layout

func (Layout) CleanStaleSessions

func (td Layout) CleanStaleSessions(ctx context.Context, logger slog.Logger, fs afero.Fs, now time.Time) error

CleanStaleSessions assumes this Layout is the latest active template version. Assuming that, any other template version directories found alongside it are considered inactive and can be removed. Inactive template versions should use ephemeral TerraformDirectories.

func (Layout) Cleanup

func (td Layout) Cleanup(ctx context.Context, logger slog.Logger, fs afero.Fs)

func (Layout) ExtractArchive

func (td Layout) ExtractArchive(ctx context.Context, logger slog.Logger, fs afero.Fs, cfg *proto.Config) error

func (Layout) ModulesDirectory

func (td Layout) ModulesDirectory() string

func (Layout) ModulesFilePath

func (td Layout) ModulesFilePath() string

func (Layout) PlanFilePath

func (td Layout) PlanFilePath() string

func (Layout) ReadmeFilePath

func (td Layout) ReadmeFilePath() string

func (Layout) SelectWorkspace

func (td Layout) SelectWorkspace(fs afero.Fs) error

SelectWorkspace writes the terraform workspace environment file, which acts as `terraform workspace select <name>`. It is quicker than using the cli command. More importantly this code can be written without changing the executor behavior, which is nice encapsulation for this experiment.

func (Layout) StateFilePath

func (td Layout) StateFilePath() string

func (Layout) StateSessionDirectory

func (td Layout) StateSessionDirectory() string

StateSessionDirectory follows the same directory structure as Terraform workspaces. All build specific state is stored within this directory.

These files should be cleaned up on exit. In the case of a failure, they will not collide with other builds since each build uses a unique session ID.

func (Layout) TerraformLockFile

func (td Layout) TerraformLockFile() string

func (Layout) TerraformMetadataDir

func (td Layout) TerraformMetadataDir() string

func (Layout) WorkDirectory

func (td Layout) WorkDirectory() string

func (Layout) WorkspaceEnvironmentFilePath

func (td Layout) WorkspaceEnvironmentFilePath() string

Jump to

Keyboard shortcuts

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