Documentation
¶
Overview ¶
Package prompt implements input-related functionality.
Index ¶
- func Confirm(ctx context.Context, message string) (confirm bool, err error)
- func ConfirmOverwrite(ctx context.Context, filename string) (confirm bool, err error)
- func Confirmf(ctx context.Context, format string, a ...interface{}) (bool, error)
- func Int(ctx context.Context, dst *int, msg string, def int, required bool) error
- func IsNonInteractive(err error) bool
- func MultiRegion(ctx context.Context, msg string, splitPaid bool, currentRegions []string, ...) (*[]api.Region, error)
- func MultiSelect(ctx context.Context, indices *[]int, msg string, def []int, options ...string) error
- func MultiSelectRegion(ctx context.Context, msg string, paid []api.Region, regions []api.Region, ...) (selectedRegions []api.Region, err error)
- func Org(ctx context.Context) (*api.Organization, error)
- func Password(ctx context.Context, dst *string, msg string, required bool) error
- func PlatformRegions(ctx context.Context) *future.Future[RegionInfo]
- func Region(ctx context.Context, splitPaid bool, params RegionParams) (*api.Region, error)
- func Select(ctx context.Context, index *int, msg, def string, options ...string) error
- func SelectAppName(ctx context.Context) (name string, err error)
- func SelectAppNameWithMsg(ctx context.Context, msg string) (name string, err error)
- func SelectOrg(ctx context.Context, orgs []api.Organization) (org *api.Organization, err error)
- func SelectRegion(ctx context.Context, msg string, paid []api.Region, regions []api.Region, ...) (region *api.Region, err error)
- func SelectVMSize(ctx context.Context, vmSizes []api.VMSize) (vmSize *api.VMSize, err error)
- func String(ctx context.Context, dst *string, msg, def string, required bool) error
- func VMSize(ctx context.Context, def string) (size *api.VMSize, err error)
- type NonInteractiveError
- type RegionInfo
- type RegionParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfirmOverwrite ¶ added in v0.0.337
func ConfirmOverwrite(ctx context.Context, filename string) (confirm bool, err error)
func Int ¶ added in v0.0.367
func Int(ctx context.Context, dst *int, msg string, def int, required bool) error
func IsNonInteractive ¶
func IsNonInteractive(err error) bool
func MultiRegion ¶ added in v0.0.367
func MultiRegion(ctx context.Context, msg string, splitPaid bool, currentRegions []string, excludedRegionCodes []string) (*[]api.Region, error)
Region returns the region the user has passed in via flag or prompts the user for one.
func MultiSelect ¶ added in v0.0.367
func MultiSelect(ctx context.Context, indices *[]int, msg string, def []int, options ...string) error
func MultiSelectRegion ¶ added in v0.0.367
func MultiSelectRegion(ctx context.Context, msg string, paid []api.Region, regions []api.Region, currentRegions []string) (selectedRegions []api.Region, err error)
func Org ¶
func Org(ctx context.Context) (*api.Organization, error)
Org returns the Organization the user has passed in via flag or prompts the user for one.
func PlatformRegions ¶ added in v0.1.5
func PlatformRegions(ctx context.Context) *future.Future[RegionInfo]
Fetches all Fly regions and app's default region. Only the first call to this function will issue an HTTP request using ctx. Subsequent calls will return the same future as the first.
func Region ¶
func Region(ctx context.Context, splitPaid bool, params RegionParams) (*api.Region, error)
Region returns the region the user has passed in via flag or prompts the user for one.
func Select ¶
func Select(ctx context.Context, index *int, msg, def string, options ...string) error
func SelectAppName ¶ added in v0.0.452
func SelectAppName(ctx context.Context) (name string, err error)
func SelectAppNameWithMsg ¶ added in v0.0.493
func SelectAppNameWithMsg(ctx context.Context, msg string) (name string, err error)
func SelectOrg ¶
func SelectOrg(ctx context.Context, orgs []api.Organization) (org *api.Organization, err error)
func SelectRegion ¶
func SelectRegion(ctx context.Context, msg string, paid []api.Region, regions []api.Region, defaultCode string) (region *api.Region, err error)
func SelectVMSize ¶ added in v0.0.367
func SelectVMSize(ctx context.Context, vmSizes []api.VMSize) (vmSize *api.VMSize, err error)
Types ¶
type NonInteractiveError ¶
type NonInteractiveError string
type RegionInfo ¶ added in v0.1.5
type RegionInfo struct {
Regions []api.Region
DefaultRegion *api.Region
}
type RegionParams ¶ added in v0.0.400
type RegionParams struct {
Message string
ExcludedRegionCodes []string
}
Click to show internal directories.
Click to hide internal directories.