Documentation
¶
Index ¶
- func ConfigureProfile(io *iostreams.IOStreams, cfg config.IConfig, appDetails *dashboard.Application, ...) error
- func CreateAndFetchApplication(io *iostreams.IOStreams, client *dashboard.Client, ...) (*dashboard.Application, string, error)
- func CreateApplicationWithRetry(io *iostreams.IOStreams, client *dashboard.Client, accessToken string, ...) (*dashboard.Application, string, error)
- func EnsureAPIKey(io *iostreams.IOStreams, client *dashboard.Client, accessToken string, ...) error
- func FindFreePlan(plans []dashboard.Plan) *dashboard.Plan
- func KnownPaidPlan(value string) *dashboard.Plan
- func PickPlan(candidates []dashboard.Plan) (*dashboard.Plan, error)
- func PlanAvailable(plans []dashboard.Plan, id string) bool
- func PlanChoices(plans []dashboard.Plan) []string
- func PlanTelemetryID(p dashboard.Plan) string
- func PromptRegion(io *iostreams.IOStreams, client *dashboard.Client, accessToken string) (string, error)
- func ResolvePlan(plans []dashboard.Plan, value string) (*dashboard.Plan, error)
- func SelectablePlans(plans []dashboard.Plan, hideNonFree bool) []dashboard.Plan
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureProfile ¶
func ConfigureProfile( io *iostreams.IOStreams, cfg config.IConfig, appDetails *dashboard.Application, profileName string, setDefault bool, ) error
ConfigureProfile creates a CLI profile from application details and optionally sets it as the default.
func CreateAndFetchApplication ¶
func CreateAndFetchApplication( io *iostreams.IOStreams, client *dashboard.Client, accessToken, region, appName string, tracker *telemetry.FlowTracker, ) (*dashboard.Application, string, error)
CreateAndFetchApplication creates an application (with region retry) and generates an API key for it. It returns the region the application was actually created in, which may differ from the requested one.
func CreateApplicationWithRetry ¶
func CreateApplicationWithRetry( io *iostreams.IOStreams, client *dashboard.Client, accessToken string, region string, appName string, tracker *telemetry.FlowTracker, ) (*dashboard.Application, string, error)
CreateApplicationWithRetry creates an application, retrying with a different region if the selected one has no available cluster.
The optional tracker (nil-safe) records which step the flow is in, so the telemetry of the calling flow can tell where the user stopped.
func EnsureAPIKey ¶
func EnsureAPIKey( io *iostreams.IOStreams, client *dashboard.Client, accessToken string, app *dashboard.Application, ) error
EnsureAPIKey generates a write API key for the application. Callers should skip this if the local profile already has a key.
func FindFreePlan ¶ added in v1.11.0
FindFreePlan returns the free-tier plan, or nil if none is present.
func KnownPaidPlan ¶ added in v1.11.0
KnownPaidPlan recognizes a documented paid --plan value even when the self-serve endpoint omits it (paid plans appear only once billing is on file).
func PlanAvailable ¶ added in v1.11.0
PlanAvailable reports whether a plan with the given id is in the list.
func PlanChoices ¶ added in v1.11.0
PlanChoices returns the user-facing plan identifiers (the free plan is shown as "free" regardless of its underlying id).
func PlanTelemetryID ¶ added in v1.11.0
PlanTelemetryID returns the plan identifier used in telemetry properties: the user-facing "free" for the free tier (whose underlying template id is not fixed and can be "build"), the plan id otherwise.
func PromptRegion ¶
func PromptRegion( io *iostreams.IOStreams, client *dashboard.Client, accessToken string, ) (string, error)
PromptRegion fetches regions from the API and prompts the user to select one.
func ResolvePlan ¶ added in v1.11.0
ResolvePlan maps a --plan value to one of the available plans. An exact match on the plan id wins; the user-facing "free" choice maps to the free-type template, whose id is not fixed (it can be "build"), so it is matched on type.
func SelectablePlans ¶ added in v1.11.0
SelectablePlans returns the plans a user may choose from. When hideNonFree is true (no payment method on file) only the free plan(s) are offered, because paid plans require billing details the CLI can't collect.
Types ¶
This section is empty.