planchange

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package planchange holds the logic shared by the "application upgrade" and "application downgrade" commands. Both commands change the current application's self-serve plan and currently behave identically, so the fetch / billing-check / terms / change flow lives here once.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, opts *Options) error

Run executes the shared plan-change flow.

Types

type Direction

type Direction int

Direction selects whether the flow offers higher-tier (upgrade) or lower-tier (downgrade) plans.

const (
	DirectionUpgrade Direction = iota
	DirectionDowngrade
)

type Options

type Options struct {
	IO     *iostreams.IOStreams
	Config config.IConfig

	Direction   Direction // upgrade or downgrade
	Plan        string    // --plan (optional): target plan, e.g. "free", "grow", "grow-plus"
	DryRun      bool      // --dry-run: preview without calling the API
	AcceptTerms bool      // --accept-terms: accept ToS in non-interactive mode

	PrintFlags *cmdutil.PrintFlags

	NewDashboardClient func(clientID string) *dashboard.Client
	Browser            func(string) error
}

Options carries everything the shared plan-change flow needs. The upgrade and downgrade commands populate it the same way.

Jump to

Keyboard shortcuts

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