Documentation
¶
Overview ¶
Package commands provides all commands associated with the CLI, and a means of executing them.
Index ¶
- func ImportDependencies(ui cli.Ui, groupID, appID, dir string, client api.StitchClient) error
- func ImportHosting(groupID, appID, rootDir string, assetMetadataDiffs *hosting.AssetMetadataDiffs, ...) error
- func NewDiffCommandFactory(ui cli.Ui) cli.CommandFactory
- func NewExportCommandFactory(ui cli.Ui) cli.CommandFactory
- func NewImportCommandFactory(ui cli.Ui) cli.CommandFactory
- func NewLoginCommandFactory(ui cli.Ui) cli.CommandFactory
- func NewLogoutCommandFactory(ui cli.Ui) cli.CommandFactory
- func NewSecretsAddCommandFactory(ui cli.Ui) cli.CommandFactory
- func NewSecretsCommandFactory(ui cli.Ui) cli.CommandFactory
- func NewSecretsListCommandFactory(ui cli.Ui) cli.CommandFactory
- func NewSecretsRemoveCommandFactory(ui cli.Ui) cli.CommandFactory
- func NewSecretsUpdateCommandFactory(ui cli.Ui) cli.CommandFactory
- func NewWhoamiCommandFactory(ui cli.Ui) cli.CommandFactory
- type BaseCommand
- func (c *BaseCommand) Ask(query string, defaultVal string) (string, error)
- func (c *BaseCommand) AskWithOptions(query, defaultValue string, options []string) (string, error)
- func (c *BaseCommand) AskYesNo(query string) (bool, error)
- func (c *BaseCommand) AtlasClient() (mdbcloud.Client, error)
- func (c *BaseCommand) AuthClient() (api.Client, error)
- func (c *BaseCommand) Client() (api.Client, error)
- func (c *BaseCommand) Help() string
- func (c *BaseCommand) NewFlagSet() *flag.FlagSet
- func (c *BaseCommand) StitchClient() (api.StitchClient, error)
- func (c *BaseCommand) User() (*user.User, error)
- type DiffCommand
- type ExportCommand
- type ImportCommand
- type LoginCommand
- type LogoutCommand
- type ProjectCommand
- type SecretsAddCommand
- type SecretsBaseCommand
- type SecretsCommand
- type SecretsListCommand
- type SecretsRemoveCommand
- type SecretsUpdateCommand
- type WhoamiCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImportDependencies ¶ added in v1.8.0
func ImportHosting ¶ added in v1.2.0
func ImportHosting(groupID, appID, rootDir string, assetMetadataDiffs *hosting.AssetMetadataDiffs, resetCache bool, client api.StitchClient, ui cli.Ui) error
ImportHosting will push local Stitch hosting assets to the server
func NewDiffCommandFactory ¶ added in v1.4.0
func NewDiffCommandFactory(ui cli.Ui) cli.CommandFactory
NewDiffCommandFactory returns a new cli.CommandFactory given a cli.Ui
func NewExportCommandFactory ¶
func NewExportCommandFactory(ui cli.Ui) cli.CommandFactory
NewExportCommandFactory returns a new cli.CommandFactory given a cli.Ui
func NewImportCommandFactory ¶
func NewImportCommandFactory(ui cli.Ui) cli.CommandFactory
NewImportCommandFactory returns a new cli.CommandFactory given a cli.Ui
func NewLoginCommandFactory ¶
func NewLoginCommandFactory(ui cli.Ui) cli.CommandFactory
NewLoginCommandFactory returns a new cli.CommandFactory given a cli.Ui
func NewLogoutCommandFactory ¶
func NewLogoutCommandFactory(ui cli.Ui) cli.CommandFactory
NewLogoutCommandFactory returns a new cli.CommandFactory given a cli.Ui
func NewSecretsAddCommandFactory ¶ added in v1.5.0
func NewSecretsAddCommandFactory(ui cli.Ui) cli.CommandFactory
NewSecretsAddCommandFactory returns a new cli.CommandFactory given a cli.Ui
func NewSecretsCommandFactory ¶ added in v1.5.0
func NewSecretsCommandFactory(ui cli.Ui) cli.CommandFactory
NewSecretsCommandFactory returns a new cli.CommandFactory given a cli.Ui
func NewSecretsListCommandFactory ¶ added in v1.5.0
func NewSecretsListCommandFactory(ui cli.Ui) cli.CommandFactory
NewSecretsListCommandFactory returns a new cli.CommandFactory given a cli.Ui
func NewSecretsRemoveCommandFactory ¶ added in v1.5.0
func NewSecretsRemoveCommandFactory(ui cli.Ui) cli.CommandFactory
NewSecretsRemoveCommandFactory returns a new cli.CommandFactory given a cli.Ui
func NewSecretsUpdateCommandFactory ¶ added in v1.5.0
func NewSecretsUpdateCommandFactory(ui cli.Ui) cli.CommandFactory
NewSecretsUpdateCommandFactory returns a new cli.CommandFactory given a cli.Ui
func NewWhoamiCommandFactory ¶
func NewWhoamiCommandFactory(ui cli.Ui) cli.CommandFactory
NewWhoamiCommandFactory returns a new cli.CommandFactory given a cli.Ui
Types ¶
type BaseCommand ¶
type BaseCommand struct { *flag.FlagSet Name string CLI *cli.CLI UI cli.Ui // contains filtered or unexported fields }
BaseCommand handles the parsing and execution of a command.
func (*BaseCommand) Ask ¶
func (c *BaseCommand) Ask(query string, defaultVal string) (string, error)
Ask is used to prompt the user for input
func (*BaseCommand) AskWithOptions ¶ added in v1.2.0
func (c *BaseCommand) AskWithOptions(query, defaultValue string, options []string) (string, error)
AskWithOptions is used to prompt user for input from a list of options
func (*BaseCommand) AskYesNo ¶
func (c *BaseCommand) AskYesNo(query string) (bool, error)
AskYesNo is used to prompt the user for yes/no input
func (*BaseCommand) AtlasClient ¶
func (c *BaseCommand) AtlasClient() (mdbcloud.Client, error)
AtlasClient returns a mdbcloud.Client for use with MDB Cloud Manager APIs
func (*BaseCommand) AuthClient ¶
func (c *BaseCommand) AuthClient() (api.Client, error)
AuthClient returns an api.Client that is aware of the current user's auth credentials. It also handles retrying requests if a user's access token has expired
func (*BaseCommand) Client ¶
func (c *BaseCommand) Client() (api.Client, error)
Client returns an api.Client for use with API calls to services
func (*BaseCommand) Help ¶
func (c *BaseCommand) Help() string
Help defines help documentation for parameters that apply to all commands
func (*BaseCommand) NewFlagSet ¶
func (c *BaseCommand) NewFlagSet() *flag.FlagSet
NewFlagSet builds and returns the default set of flags for all commands
func (*BaseCommand) StitchClient ¶
func (c *BaseCommand) StitchClient() (api.StitchClient, error)
StitchClient returns an api.StitchClient for use in calling the API
type DiffCommand ¶ added in v1.4.0
type DiffCommand struct { *BaseCommand // contains filtered or unexported fields }
DiffCommand is used to view the changes you would make to the Stitch App
func (*DiffCommand) Help ¶ added in v1.4.0
func (dc *DiffCommand) Help() string
Help returns long-form help information for this command
func (*DiffCommand) Run ¶ added in v1.4.0
func (dc *DiffCommand) Run(args []string) int
Run executes the command
func (*DiffCommand) Synopsis ¶ added in v1.4.0
func (dc *DiffCommand) Synopsis() string
Synopsis returns a one-liner description for this command
type ExportCommand ¶
type ExportCommand struct { *BaseCommand // contains filtered or unexported fields }
ExportCommand is used to export a Stitch App
func (*ExportCommand) Help ¶
func (ec *ExportCommand) Help() string
Help returns long-form help information for this command
func (*ExportCommand) Run ¶
func (ec *ExportCommand) Run(args []string) int
Run executes the command
func (*ExportCommand) Synopsis ¶
func (ec *ExportCommand) Synopsis() string
Synopsis returns a one-liner description for this command
type ImportCommand ¶
type ImportCommand struct { *BaseCommand // contains filtered or unexported fields }
ImportCommand is used to import a Stitch App
func (*ImportCommand) Help ¶
func (ic *ImportCommand) Help() string
Help returns long-form help information for this command
func (*ImportCommand) Run ¶
func (ic *ImportCommand) Run(args []string) int
Run executes the command
func (*ImportCommand) Synopsis ¶
func (ic *ImportCommand) Synopsis() string
Synopsis returns a one-liner description for this command
type LoginCommand ¶
type LoginCommand struct { *BaseCommand // contains filtered or unexported fields }
LoginCommand is used to authenticate a user given an API key and username
func (*LoginCommand) Help ¶
func (lc *LoginCommand) Help() string
Help returns long-form help information for this command
func (*LoginCommand) Synopsis ¶
func (lc *LoginCommand) Synopsis() string
Synopsis returns a one-liner description for this command
type LogoutCommand ¶
type LogoutCommand struct {
*BaseCommand
}
LogoutCommand deauthenticates a user and clears out their auth credentials from storage
func (*LogoutCommand) Help ¶
func (lc *LogoutCommand) Help() string
Help returns long-form help information for this command
func (*LogoutCommand) Run ¶
func (lc *LogoutCommand) Run(args []string) int
Run executes the command
func (*LogoutCommand) Synopsis ¶
func (lc *LogoutCommand) Synopsis() string
Synopsis returns a one-liner description for this command
type ProjectCommand ¶ added in v1.7.0
type ProjectCommand struct { *BaseCommand // contains filtered or unexported fields }
ProjectCommand handles the parsing and execution of an Atlas project-based command.
func NewProjectCommand ¶ added in v1.7.0
func NewProjectCommand(name string, ui cli.Ui) *ProjectCommand
NewProjectCommand returns a new *ProjectCommand
func (*ProjectCommand) Help ¶ added in v1.7.0
func (pc *ProjectCommand) Help() string
Help defines help documentation for parameters that apply to project commands
type SecretsAddCommand ¶ added in v1.5.0
type SecretsAddCommand struct { *SecretsBaseCommand // contains filtered or unexported fields }
SecretsAddCommand is used to add secrets to a Stitch app
func (*SecretsAddCommand) Help ¶ added in v1.5.0
func (sac *SecretsAddCommand) Help() string
Help returns long-form help information for this command
func (*SecretsAddCommand) Run ¶ added in v1.5.0
func (sac *SecretsAddCommand) Run(args []string) int
Run executes the command
func (*SecretsAddCommand) Synopsis ¶ added in v1.5.0
func (sac *SecretsAddCommand) Synopsis() string
Synopsis returns a one-liner description for this command
type SecretsBaseCommand ¶ added in v1.7.0
type SecretsBaseCommand struct { *ProjectCommand // contains filtered or unexported fields }
SecretsBaseCommand represents a common Atlas project-based secrets command
func NewSecretsBaseCommand ¶ added in v1.7.0
func NewSecretsBaseCommand(name, workingDirectory string, ui cli.Ui) *SecretsBaseCommand
NewSecretsBaseCommand returns a new *SecretsBaseCommand
func (*SecretsBaseCommand) Help ¶ added in v1.7.0
func (sbc *SecretsBaseCommand) Help() string
Help returns long-form help information for the SecretsBaseCommand command
type SecretsCommand ¶ added in v1.5.0
type SecretsCommand struct {
*BaseCommand
}
SecretsCommand is used to run CRUD operations on a Stitch App's secrets
func (*SecretsCommand) Help ¶ added in v1.5.0
func (sc *SecretsCommand) Help() string
Help returns long-form help information for this command
func (*SecretsCommand) Run ¶ added in v1.5.0
func (sc *SecretsCommand) Run(args []string) int
Run executes the command
func (*SecretsCommand) Synopsis ¶ added in v1.5.0
func (sc *SecretsCommand) Synopsis() string
Synopsis returns a one-liner description for this command
type SecretsListCommand ¶ added in v1.5.0
type SecretsListCommand struct {
*SecretsBaseCommand
}
SecretsListCommand is used to list secrets from a Stitch app
func (*SecretsListCommand) Help ¶ added in v1.5.0
func (slc *SecretsListCommand) Help() string
Help returns long-form help information for this command
func (*SecretsListCommand) Run ¶ added in v1.5.0
func (slc *SecretsListCommand) Run(args []string) int
Run executes the command
func (*SecretsListCommand) Synopsis ¶ added in v1.5.0
func (slc *SecretsListCommand) Synopsis() string
Synopsis returns a one-liner description for this command
type SecretsRemoveCommand ¶ added in v1.5.0
type SecretsRemoveCommand struct { *SecretsBaseCommand // contains filtered or unexported fields }
SecretsRemoveCommand is used to remove secrets from a Stitch app
func (*SecretsRemoveCommand) Help ¶ added in v1.5.0
func (src *SecretsRemoveCommand) Help() string
Help returns long-form help information for this command
func (*SecretsRemoveCommand) Run ¶ added in v1.5.0
func (src *SecretsRemoveCommand) Run(args []string) int
Run executes the command
func (*SecretsRemoveCommand) Synopsis ¶ added in v1.5.0
func (src *SecretsRemoveCommand) Synopsis() string
Synopsis returns a one-liner description for this command
type SecretsUpdateCommand ¶ added in v1.5.0
type SecretsUpdateCommand struct { *SecretsBaseCommand // contains filtered or unexported fields }
SecretsUpdateCommand is used to update a secret from a Stitch app
func (*SecretsUpdateCommand) Help ¶ added in v1.5.0
func (suc *SecretsUpdateCommand) Help() string
Help returns long-form help information for this command
func (*SecretsUpdateCommand) Run ¶ added in v1.5.0
func (suc *SecretsUpdateCommand) Run(args []string) int
Run executes the command
func (*SecretsUpdateCommand) Synopsis ¶ added in v1.5.0
func (suc *SecretsUpdateCommand) Synopsis() string
Synopsis returns a one-liner description for this command
type WhoamiCommand ¶
type WhoamiCommand struct {
*BaseCommand
}
WhoamiCommand is used to print the name and API key of the current user
func (*WhoamiCommand) Help ¶
func (whoami *WhoamiCommand) Help() string
Help returns long-form help information for this command
func (*WhoamiCommand) Run ¶
func (whoami *WhoamiCommand) Run(args []string) int
Run executes the command
func (*WhoamiCommand) Synopsis ¶
func (whoami *WhoamiCommand) Synopsis() string
Synopsis returns a one-liner description for this command