command

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: MPL-2.0 Imports: 57 Imported by: 0

Documentation

Overview

Package command contains all the logic for different commands within the CLI. It is the main gateway to doing operations against the Phobos API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConfigureCommandFactory

func NewConfigureCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewConfigureCommandFactory returns a configureCommand struct.

func NewConfigureDeleteCommandFactory

func NewConfigureDeleteCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewConfigureDeleteCommandFactory returns a configureDeleteCommand struct.

func NewConfigureListCommandFactory

func NewConfigureListCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewConfigureListCommandFactory returns a configureListCommand struct.

func NewFmtCommandFactory

func NewFmtCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewFmtCommandFactory returns an fmtCommand struct.

func NewHelpCommandFactory

func NewHelpCommandFactory(synopsisText, helpText string) func() (cli.Command, error)

NewHelpCommandFactory returns a helpCommand struct.

func NewLoginCommandFactory

func NewLoginCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewLoginCommandFactory returns a loginCommand struct.

func NewOrganizationCreateCommandFactory

func NewOrganizationCreateCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewOrganizationCreateCommandFactory returns an organizationCreateCommand struct.

func NewOrganizationDeleteCommandFactory

func NewOrganizationDeleteCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewOrganizationDeleteCommandFactory returns an organizationDeleteCommand struct.

func NewOrganizationGetCommandFactory

func NewOrganizationGetCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewOrganizationGetCommandFactory returns an organizationGetCommand struct.

func NewOrganizationListCommandFactory

func NewOrganizationListCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewOrganizationListCommandFactory returns an organizationListCommand struct.

func NewOrganizationUpdateCommandFactory

func NewOrganizationUpdateCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewOrganizationUpdateCommandFactory returns an organizationUpdateCommand struct.

func NewPipelineCancelCommandFactory

func NewPipelineCancelCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewPipelineCancelCommandFactory returns a pipelineCancelCommand struct.

func NewPipelineCreateCommandFactory

func NewPipelineCreateCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewPipelineCreateCommandFactory returns a pipelineCreateCommand struct.

func NewPipelineGetCommandFactory

func NewPipelineGetCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewPipelineGetCommandFactory returns a pipelineGetCommand struct.

func NewPipelineListCommandFactory

func NewPipelineListCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewPipelineListCommandFactory returns a pipelineListCommand struct.

func NewPipelineTemplateCreateCommandFactory

func NewPipelineTemplateCreateCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewPipelineTemplateCreateCommandFactory returns a pipelineTemplateCreateCommand struct.

func NewPipelineTemplateDeleteCommandFactory

func NewPipelineTemplateDeleteCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewPipelineTemplateDeleteCommandFactory returns a pipelineTemplateDeleteCommand struct.

func NewPipelineTemplateGetCommandFactory

func NewPipelineTemplateGetCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewPipelineTemplateGetCommandFactory returns a pipelineTemplateGetCommand struct.

func NewPipelineTemplateListCommandFactory

func NewPipelineTemplateListCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewPipelineTemplateListCommandFactory returns a pipelineTemplateListCommand struct.

func NewPipelineValidateCommandFactory

func NewPipelineValidateCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewPipelineValidateCommandFactory returns a pipelineValidateCommand struct.

func NewPluginCreateCommandFactory

func NewPluginCreateCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewPluginCreateCommandFactory returns a pluginCreateCommand struct.

func NewPluginDeleteCommandFactory

func NewPluginDeleteCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewPluginDeleteCommandFactory returns a pluginDeleteCommand struct.

func NewPluginDeletePlatformCommandFactory

func NewPluginDeletePlatformCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewPluginDeletePlatformCommandFactory returns a pluginDeletePlatformCommand struct.

func NewPluginDeleteVersionCommandFactory

func NewPluginDeleteVersionCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewPluginDeleteVersionCommandFactory returns a pluginDeleteVersionCommand struct.

func NewPluginGetCommandFactory

func NewPluginGetCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewPluginGetCommandFactory returns a pluginGetCommand struct.

func NewPluginGetPlatformCommandFactory

func NewPluginGetPlatformCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewPluginGetPlatformCommandFactory returns a pluginGetPlatformCommand struct.

func NewPluginGetVersionCommandFactory

func NewPluginGetVersionCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewPluginGetVersionCommandFactory returns a pluginGetVersionCommand struct.

func NewPluginInstallCommandFactory

func NewPluginInstallCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewPluginInstallCommandFactory returns a pluginInstallCommand struct.

func NewPluginLaunchCommandFactory

func NewPluginLaunchCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewPluginLaunchCommandFactory returns a pluginLaunchCommand struct.

func NewPluginListCommandFactory

func NewPluginListCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewPluginListCommandFactory returns a pluginListCommand struct.

func NewPluginListPlatformsCommandFactory

func NewPluginListPlatformsCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewPluginListPlatformsCommandFactory returns a pluginListPlatformsCommand struct.

func NewPluginListVersionsCommandFactory

func NewPluginListVersionsCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewPluginListVersionsCommandFactory returns a pluginListVersionsCommand struct.

func NewPluginUpdateCommandFactory

func NewPluginUpdateCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewPluginUpdateCommandFactory returns a pluginUpdateCommand struct.

func NewPluginUploadVersionCommandFactory

func NewPluginUploadVersionCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewPluginUploadVersionCommandFactory returns a pluginUploadVersionCommand struct.

func NewProjectCreateCommandFactory

func NewProjectCreateCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewProjectCreateCommandFactory returns a projectCreateCommand struct.

func NewProjectDeleteCommandFactory

func NewProjectDeleteCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewProjectDeleteCommandFactory returns a projectDeleteCommand struct.

func NewProjectGetCommandFactory

func NewProjectGetCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewProjectGetCommandFactory returns a projectGetCommand struct.

func NewProjectListCommandFactory

func NewProjectListCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewProjectListCommandFactory returns a projectListCommand struct.

func NewProjectUpdateCommandFactory

func NewProjectUpdateCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewProjectUpdateCommandFactory returns a projectUpdateCommand struct.

func NewReleaseAddParticipantCommandFactory

func NewReleaseAddParticipantCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewReleaseAddParticipantCommandFactory returns a releaseAddParticipantCommand struct.

func NewReleaseCreateCommandFactory

func NewReleaseCreateCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewReleaseCreateCommandFactory returns a releaseCreateCommand struct.

func NewReleaseDeleteCommandFactory

func NewReleaseDeleteCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewReleaseDeleteCommandFactory returns a releaseDeleteCommand struct.

func NewReleaseGetCommandFactory

func NewReleaseGetCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewReleaseGetCommandFactory returns a releaseGetCommand struct.

func NewReleaseLifecycleCreateCommandFactory

func NewReleaseLifecycleCreateCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewReleaseLifecycleCreateCommandFactory returns a releaseLifecycleCreateCommand struct.

func NewReleaseLifecycleDeleteCommandFactory

func NewReleaseLifecycleDeleteCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewReleaseLifecycleDeleteCommandFactory returns a releaseLifecycleDeleteCommand struct.

func NewReleaseLifecycleGetCommandFactory

func NewReleaseLifecycleGetCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewReleaseLifecycleGetCommandFactory returns a releaseLifecycleGetCommand struct.

func NewReleaseLifecycleListCommandFactory

func NewReleaseLifecycleListCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewReleaseLifecycleListCommandFactory returns a releaseLifecycleListCommand struct.

func NewReleaseLifecycleUpdateCommandFactory

func NewReleaseLifecycleUpdateCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewReleaseLifecycleUpdateCommandFactory returns a releaseLifecycleUpdateCommand struct.

func NewReleaseLifecycleValidateCommandFactory

func NewReleaseLifecycleValidateCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewReleaseLifecycleValidateCommandFactory returns a releaseLifecycleValidateCommand struct.

func NewReleaseListCommand

func NewReleaseListCommand(basicCommand *BasicCommand) func() (cli.Command, error)

NewReleaseListCommand returns a new releaseListCommand struct.

func NewReleaseRemoveParticipantCommandFactory

func NewReleaseRemoveParticipantCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewReleaseRemoveParticipantCommandFactory returns a releaseRemoveParticipantCommand struct.

func NewReleaseUpdateCommandFactory

func NewReleaseUpdateCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewReleaseUpdateCommandFactory returns a releaseUpdateCommand struct.

func NewReleaseUpdateDeploymentCommandFactory

func NewReleaseUpdateDeploymentCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewReleaseUpdateDeploymentCommandFactory returns a releaseUpdateDeploymentCommand struct.

func NewVersionCommandFactory added in v0.6.0

func NewVersionCommandFactory(basicCommand *BasicCommand) func() (cli.Command, error)

NewVersionCommandFactory returns an instance of versionCommand.

Types

type BasicCommand

type BasicCommand struct {
	Context context.Context
	Logger  hclog.Logger
	UI      terminal.UI

	Version             string
	DisplayTitle        string
	BinaryName          string
	CurrentProfileName  string
	DefaultHTTPEndpoint string

	DefaultTLSSkipVerify bool
	// contains filtered or unexported fields
}

BasicCommand contains data needed by all the CLI commands. It provides access to the UI, logger and other metadata information. Private fields are only populated after initialize() has been called and are entirely controllable by using the basicOptions above.

func (*BasicCommand) Close

func (c *BasicCommand) Close() error

Close closes any pending resources.

type BasicOptionsFunc

type BasicOptionsFunc func(*basicOptions) error

BasicOptionsFunc is an alias that allows setting basicOptions.

func WithArguments

func WithArguments(args []string) BasicOptionsFunc

WithArguments sets the raw arguments that are passed into a command. It facilitates the parsing of flags and arguments.

func WithClient

func WithClient(withAuth bool) BasicOptionsFunc

WithClient indicates that a gRPC client is needed by the command. Callers can set the withAuth parameter to indicate if client should be initialized with auth. Client should be available on the BasicCommand struct after initialize() has been called.

func WithCommandName

func WithCommandName(name string) BasicOptionsFunc

WithCommandName is the name of the command that called BasicCommand.initialize(). It should always be set as it allows for helpful debugger statements.

func WithFlags

func WithFlags(flags *flag.FlagSet) BasicOptionsFunc

WithFlags sets the FlagSet that needs to be parsed. Return values are often set as fields on the caller command's struct.

func WithInputValidator

func WithInputValidator(inputValidator func() error) BasicOptionsFunc

WithInputValidator allows the calling command to pass in a input validator func, which once called, ensures proper data was passed into command. It can be used to make sure a flag was specified, or the value is a URL, etc.

Jump to

Keyboard shortcuts

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