Documentation
¶
Index ¶
- Constants
- Variables
- func CreateInDirectory(workingDirectory string, params Parameters) (string, error)
- func LoadStackEnv(params Parameters, overload bool) error
- func MakeDefaultName(providerId client.ProviderID, region string) string
- func MakeStackSelectorLabels(stacks []ListItem) map[string]string
- func Marshal(params *Parameters) (string, error)
- func NewManager(fabric Lister, targetDirectory string, projectName string, ...) (*manager, error)
- func NewSelector(ec elicitations.Controller, sm Manager) *stackSelector
- func PrintCreateMessage(stackName string)
- func RemoveInDirectory(workingDirectory, name string) error
- func ValidStackName(val any) error
- type AWSProfileLister
- type ErrNotExist
- type ErrOutside
- type FileSystemAWSProfileLister
- type GetStackOpts
- type ListItem
- type Lister
- type Manager
- type Parameters
- type SelectStackOptions
- type Wizard
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 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 ValidStackName ¶
Types ¶
type AWSProfileLister ¶
type ErrNotExist ¶
type ErrNotExist struct {
StackName string
}
func (*ErrNotExist) Error ¶
func (e *ErrNotExist) Error() string
type ErrOutside ¶
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 ListInDirectory ¶
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 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)
Click to show internal directories.
Click to hide internal directories.