Documentation ¶
Overview ¶
Package commands provides all commands associated with the CLI, and a means of executing them.
Index ¶
- func ImportHosting(groupID, appID, rootDir string, assetMetadataDiffs *hosting.AssetMetadataDiffs, ...) error
- 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 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 ExportCommand
- type ImportCommand
- type LoginCommand
- type LogoutCommand
- type WhoamiCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 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 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 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 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 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