stacks

package
v0.0.0-...-66c9f5b Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBeta = "beta"
	Directory   = ".defang"
)
View Source
const CreateNewStack = "Create new stack"

Variables

View Source
var ErrDefaultStackNotSet = errors.New("no default stack set for project")

Functions

func CreateInDirectory

func CreateInDirectory(workingDirectory string, params Parameters) (string, error)

func LoadStackEnv

func LoadStackEnv(params Parameters, overload bool) error

This was basically ripped out of godotenv.Overload/Load. Unfortunately, they don't export a function that loads a map[string]string, so we have to reimplement it here.

func MakeDefaultName

func MakeDefaultName(providerId client.ProviderID, region string) string

func MakeStackSelectorLabels

func MakeStackSelectorLabels(stacks []ListItem) map[string]string

func Marshal

func Marshal(params *Parameters) (string, error)

func NewManager

func NewManager(fabric Lister, targetDirectory string, projectName string, ec elicitations.Controller) (*manager, error)

func NewSelector

func NewSelector(ec elicitations.Controller, sm Manager) *stackSelector

func PrintCreateMessage

func PrintCreateMessage(stackName string)

func RemoveInDirectory

func RemoveInDirectory(workingDirectory, name string) error

func ValidStackName

func ValidStackName(val any) error

Types

type AWSProfileLister

type AWSProfileLister interface {
	ListProfiles() ([]string, error)
}

type ErrNotExist

type ErrNotExist struct {
	StackName string
}

func (*ErrNotExist) Error

func (e *ErrNotExist) Error() string

type ErrOutside

type ErrOutside struct {
	Operation       string
	TargetDirectory string
}

func (*ErrOutside) Error

func (e *ErrOutside) Error() string

type FileSystemAWSProfileLister

type FileSystemAWSProfileLister struct{}

func (*FileSystemAWSProfileLister) ListProfiles

func (f *FileSystemAWSProfileLister) ListProfiles() ([]string, error)

type GetStackOpts

type GetStackOpts struct {
	Default     Parameters
	Interactive bool
	SelectStackOptions
}

type ListItem

type ListItem struct {
	Parameters
	Default    bool
	DeployedAt time.Time
}

for shell printing for converting to string format of StackParameters

func List

func List() ([]ListItem, error)

func ListInDirectory

func ListInDirectory(workingDirectory string) ([]ListItem, error)

type Lister

type Lister interface {
	ListStacks(ctx context.Context, req *defangv1.ListStacksRequest) (*defangv1.ListStacksResponse, error)
	GetDefaultStack(ctx context.Context, req *defangv1.GetDefaultStackRequest) (*defangv1.GetStackResponse, error)
}

type Manager

type Manager interface {
	List(ctx context.Context) ([]ListItem, error)
	Create(params Parameters) (string, error)
}

type Parameters

type Parameters struct {
	Name      string
	Provider  client.ProviderID
	Mode      modes.Mode
	Region    string
	Variables map[string]string
}

func NewParametersFromContent

func NewParametersFromContent(name string, content []byte) (*Parameters, error)

func ReadInDirectory

func ReadInDirectory(workingDirectory, name string) (*Parameters, error)

func (Parameters) ToMap

func (sp Parameters) ToMap() map[string]string

type SelectStackOptions

type SelectStackOptions struct {
	AllowStackCreation bool
}

type Wizard

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

func NewWizard

func NewWizard(ec elicitations.Controller) *Wizard

func NewWizardWithProfileLister

func NewWizardWithProfileLister(ec elicitations.Controller, profileLister AWSProfileLister) *Wizard

func (*Wizard) CollectParameters

func (w *Wizard) CollectParameters(ctx context.Context) (*Parameters, error)

func (*Wizard) CollectRemainingParameters

func (w *Wizard) CollectRemainingParameters(ctx context.Context, params *Parameters) (*Parameters, error)

Jump to

Keyboard shortcuts

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