Documentation
¶
Index ¶
- Constants
- func LinkAppFooterSection(ctx context.Context, clients *shared.ClientFactory, app *types.App)
- func LinkAppHeaderSection(ctx context.Context, clients *shared.ClientFactory, shouldConfirm bool)
- func LinkCommandRunE(ctx context.Context, clients *shared.ClientFactory, app *types.App) (err error)
- func LinkExistingApp(ctx context.Context, clients *shared.ClientFactory, app *types.App, ...) (err error)
- func NewAddCommand(clients *shared.ClientFactory) *cobra.Command
- func NewCommand(clients *shared.ClientFactory) *cobra.Command
- func NewDeleteCommand(clients *shared.ClientFactory) *cobra.Command
- func NewLinkCommand(clients *shared.ClientFactory) *cobra.Command
- func NewListCommand(clients *shared.ClientFactory) *cobra.Command
- func NewSettingsCommand(clients *shared.ClientFactory) *cobra.Command
- func NewUninstallCommand(clients *shared.ClientFactory) *cobra.Command
- func NewUnlinkCommand(clients *shared.ClientFactory) *cobra.Command
- func RunAddCommand(ctx context.Context, clients *shared.ClientFactory, ...) (context.Context, types.InstallState, types.App, error)
- func RunDeleteCommand(ctx context.Context, clients *shared.ClientFactory, cmd *cobra.Command, ...) (types.App, error)
- func RunUninstallCommand(ctx context.Context, clients *shared.ClientFactory, cmd *cobra.Command, ...) (types.App, error)
- func UnlinkCommandRunE(ctx context.Context, clients *shared.ClientFactory, cmd *cobra.Command, ...) (types.App, error)
- type AppMock
Constants ¶
const LinkAppConfirmPromptText = "Do you want to add an existing app?"
LinkAppConfirmPromptText is displayed when prompting to add an existing app
Variables ¶
This section is empty.
Functions ¶
func LinkAppFooterSection ¶
LinkAppFooterSection displays the details of app that was added to the project.
func LinkAppHeaderSection ¶
func LinkAppHeaderSection(ctx context.Context, clients *shared.ClientFactory, shouldConfirm bool)
LinkAppHeaderSection displays a section explaining how to find existing apps. External callers can use extraSecondaryText to show additional information. When shouldConfirm is true, additional information is included in the header explaining how to link apps, in case the user declines.
func LinkCommandRunE ¶
func LinkCommandRunE(ctx context.Context, clients *shared.ClientFactory, app *types.App) (err error)
LinkCommandRunE saves details about the provided application
func LinkExistingApp ¶
func LinkExistingApp(ctx context.Context, clients *shared.ClientFactory, app *types.App, shouldConfirm bool) (err error)
LinkExistingApp prompts for an existing App ID and saves the details to the project. When shouldConfirm is true, a confirmation prompt will ask the user if they want to link an existing app and additional information is included in the header. The shouldConfirm option is encouraged for third-party callers.
func NewAddCommand ¶
func NewAddCommand(clients *shared.ClientFactory) *cobra.Command
NewAddCommand returns a new Cobra command
func NewCommand ¶
func NewCommand(clients *shared.ClientFactory) *cobra.Command
NewCommand returns a new Cobra command for apps
func NewDeleteCommand ¶
func NewDeleteCommand(clients *shared.ClientFactory) *cobra.Command
NewDeleteCommand returns a new Cobra command
func NewLinkCommand ¶
func NewLinkCommand(clients *shared.ClientFactory) *cobra.Command
NewLinkCommand returns a new Cobra command for link
func NewListCommand ¶
func NewListCommand(clients *shared.ClientFactory) *cobra.Command
NewListCommand returns a new Cobra command
func NewSettingsCommand ¶
func NewSettingsCommand(clients *shared.ClientFactory) *cobra.Command
func NewUninstallCommand ¶
func NewUninstallCommand(clients *shared.ClientFactory) *cobra.Command
NewUninstallCommand returns a new Cobra command
func NewUnlinkCommand ¶
func NewUnlinkCommand(clients *shared.ClientFactory) *cobra.Command
NewUnlinkCommand returns a new Cobra command for unlinking apps
func RunAddCommand ¶
func RunAddCommand(ctx context.Context, clients *shared.ClientFactory, selection *prompts.SelectedApp, orgGrantWorkspaceID string) (context.Context, types.InstallState, types.App, error)
RunAddCommand executes the workspace install command, prints output, and returns any errors.
func RunDeleteCommand ¶
func RunDeleteCommand(ctx context.Context, clients *shared.ClientFactory, cmd *cobra.Command, args []string) (types.App, error)
RunDeleteCommand executes the workspace delete command, prints output, and returns any errors.
Types ¶
type AppMock ¶
AppMock implementation mocks for the app package
func NewAppCommandMock ¶
func NewAppCommandMock() *AppMock
NewAppCommandMock returns a mock of the Workspace prompts.
func (*AppMock) RunAddCommand ¶
func (m *AppMock) RunAddCommand(ctx context.Context, clients *shared.ClientFactory, selectedApp *prompts.SelectedApp, orgGrant string) (context.Context, types.InstallState, types.App, error)
RunAddCommand mocks the app add (install) command