workdir

package
v1.203.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetWorkdirCommand

func GetWorkdirCommand() *cobra.Command

GetWorkdirCommand returns the workdir command for parent registration.

func SetAtmosConfig

func SetAtmosConfig(config *schema.AtmosConfiguration)

SetAtmosConfig sets the Atmos configuration for the workdir command. This is called from root.go after atmosConfig is initialized.

func SetWorkdirManager

func SetWorkdirManager(manager WorkdirManager)

SetWorkdirManager sets the workdir manager (for testing).

Types

type DefaultWorkdirManager

type DefaultWorkdirManager struct{}

DefaultWorkdirManager is the default implementation of WorkdirManager.

func NewDefaultWorkdirManager

func NewDefaultWorkdirManager() *DefaultWorkdirManager

NewDefaultWorkdirManager creates a new DefaultWorkdirManager.

func (*DefaultWorkdirManager) CleanAllWorkdirs

func (m *DefaultWorkdirManager) CleanAllWorkdirs(atmosConfig *schema.AtmosConfiguration) error

CleanAllWorkdirs removes all workdirs.

func (*DefaultWorkdirManager) CleanWorkdir

func (m *DefaultWorkdirManager) CleanWorkdir(atmosConfig *schema.AtmosConfiguration, component, stack string) error

CleanWorkdir removes a specific workdir.

func (*DefaultWorkdirManager) DescribeWorkdir

func (m *DefaultWorkdirManager) DescribeWorkdir(atmosConfig *schema.AtmosConfiguration, component, stack string) (string, error)

DescribeWorkdir returns a valid stack manifest snippet for the workdir.

func (*DefaultWorkdirManager) GetWorkdirInfo

func (m *DefaultWorkdirManager) GetWorkdirInfo(atmosConfig *schema.AtmosConfiguration, component, stack string) (*WorkdirInfo, error)

GetWorkdirInfo returns information about a specific workdir.

func (*DefaultWorkdirManager) ListWorkdirs

func (m *DefaultWorkdirManager) ListWorkdirs(atmosConfig *schema.AtmosConfiguration) ([]WorkdirInfo, error)

ListWorkdirs returns all workdirs in the project.

type WorkdirInfo

type WorkdirInfo struct {
	// Name is the workdir directory name (e.g., "dev-vpc").
	Name string `json:"name" yaml:"name"`

	// Component is the component name.
	Component string `json:"component" yaml:"component"`

	// Stack is the stack name.
	Stack string `json:"stack" yaml:"stack"`

	// Source is the source path (component folder).
	Source string `json:"source" yaml:"source"`

	// Path is the workdir path relative to project root.
	Path string `json:"path" yaml:"path"`

	// ContentHash is a hash of the source content.
	ContentHash string `json:"content_hash,omitempty" yaml:"content_hash,omitempty"`

	// CreatedAt is when the workdir was created.
	CreatedAt time.Time `json:"created_at" yaml:"created_at"`

	// UpdatedAt is when the workdir was last updated.
	UpdatedAt time.Time `json:"updated_at" yaml:"updated_at"`
}

WorkdirInfo contains information about a workdir for display purposes.

type WorkdirManager

type WorkdirManager interface {
	// ListWorkdirs returns all workdirs in the project.
	ListWorkdirs(atmosConfig *schema.AtmosConfiguration) ([]WorkdirInfo, error)

	// GetWorkdirInfo returns information about a specific workdir.
	GetWorkdirInfo(atmosConfig *schema.AtmosConfiguration, component, stack string) (*WorkdirInfo, error)

	// DescribeWorkdir returns a valid stack manifest snippet for the workdir.
	DescribeWorkdir(atmosConfig *schema.AtmosConfiguration, component, stack string) (string, error)

	// CleanWorkdir removes a specific workdir.
	CleanWorkdir(atmosConfig *schema.AtmosConfiguration, component, stack string) error

	// CleanAllWorkdirs removes all workdirs.
	CleanAllWorkdirs(atmosConfig *schema.AtmosConfiguration) error
}

WorkdirManager defines the interface for workdir operations. This interface enables dependency injection for testing.

func GetWorkdirManager

func GetWorkdirManager() WorkdirManager

GetWorkdirManager returns the current workdir manager.

Jump to

Keyboard shortcuts

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