commands

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package commands provides all commands associated with the CLI, and a means of executing them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImportDependencies

func ImportDependencies(ui cli.Ui, groupID, appID, dir string, client api.RealmClient) error

func ImportHosting

func ImportHosting(groupID, appID, rootDir string, assetMetadataDiffs *hosting.AssetMetadataDiffs, resetCache bool, client api.RealmClient, ui cli.Ui) error

ImportHosting will push local Realm hosting assets to the server

func NewDiffCommandFactory

func NewDiffCommandFactory(ui cli.Ui, telemetryService *telemetry.Service) cli.CommandFactory

NewDiffCommandFactory returns a new cli.CommandFactory given a cli.Ui

func NewExportCommandFactory

func NewExportCommandFactory(ui cli.Ui, telemetryService *telemetry.Service) cli.CommandFactory

NewExportCommandFactory returns a new cli.CommandFactory given a cli.Ui

func NewImportCommandFactory

func NewImportCommandFactory(ui cli.Ui, telemetryService *telemetry.Service) cli.CommandFactory

NewImportCommandFactory returns a new cli.CommandFactory given a cli.Ui

func NewLoginCommandFactory

func NewLoginCommandFactory(ui cli.Ui, telemetryService *telemetry.Service) cli.CommandFactory

NewLoginCommandFactory returns a new cli.CommandFactory given a cli.Ui

func NewLogoutCommandFactory

func NewLogoutCommandFactory(ui cli.Ui, telemetryService *telemetry.Service) cli.CommandFactory

NewLogoutCommandFactory returns a new cli.CommandFactory given a cli.Ui

func NewSecretsAddCommandFactory

func NewSecretsAddCommandFactory(ui cli.Ui, telemetryService *telemetry.Service) cli.CommandFactory

NewSecretsAddCommandFactory returns a new cli.CommandFactory given a cli.Ui

func NewSecretsCommandFactory

func NewSecretsCommandFactory(ui cli.Ui, telemetryService *telemetry.Service) cli.CommandFactory

NewSecretsCommandFactory returns a new cli.CommandFactory given a cli.Ui

func NewSecretsListCommandFactory

func NewSecretsListCommandFactory(ui cli.Ui, telemetryService *telemetry.Service) cli.CommandFactory

NewSecretsListCommandFactory returns a new cli.CommandFactory given a cli.Ui

func NewSecretsRemoveCommandFactory

func NewSecretsRemoveCommandFactory(ui cli.Ui, telemetryService *telemetry.Service) cli.CommandFactory

NewSecretsRemoveCommandFactory returns a new cli.CommandFactory given a cli.Ui

func NewSecretsUpdateCommandFactory

func NewSecretsUpdateCommandFactory(ui cli.Ui, telemetryService *telemetry.Service) cli.CommandFactory

NewSecretsUpdateCommandFactory returns a new cli.CommandFactory given a cli.Ui

func NewWhoamiCommandFactory

func NewWhoamiCommandFactory(ui cli.Ui, telemetryService *telemetry.Service) 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
	TelemetryService *telemetry.Service
	// 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

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) RealmClient

func (c *BaseCommand) RealmClient() (api.RealmClient, error)

RealmClient returns an api.RealmClient for use in calling the API

func (*BaseCommand) User

func (c *BaseCommand) User() (*user.User, error)

User returns the current user. It loads the user from storage if it is not available in memory

type DiffCommand

type DiffCommand struct {
	*BaseCommand
	// contains filtered or unexported fields
}

DiffCommand is used to view the changes you would make to the Realm App

func (*DiffCommand) Help

func (dc *DiffCommand) Help() string

Help returns long-form help information for this command

func (*DiffCommand) Run

func (dc *DiffCommand) Run(args []string) int

Run executes the command

func (*DiffCommand) Synopsis

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 Realm 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 Realm 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) Run

func (lc *LoginCommand) Run(args []string) int

Run executes the 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

type ProjectCommand struct {
	*BaseCommand
	// contains filtered or unexported fields
}

ProjectCommand handles the parsing and execution of an Atlas project-based command.

func NewProjectCommand

func NewProjectCommand(name string, ui cli.Ui, telemetryService *telemetry.Service) *ProjectCommand

NewProjectCommand returns a new *ProjectCommand

func (*ProjectCommand) Help

func (pc *ProjectCommand) Help() string

Help defines help documentation for parameters that apply to project commands

type SecretsAddCommand

type SecretsAddCommand struct {
	*SecretsBaseCommand
	// contains filtered or unexported fields
}

SecretsAddCommand is used to add secrets to a Realm app

func (*SecretsAddCommand) Help

func (sac *SecretsAddCommand) Help() string

Help returns long-form help information for this command

func (*SecretsAddCommand) Run

func (sac *SecretsAddCommand) Run(args []string) int

Run executes the command

func (*SecretsAddCommand) Synopsis

func (sac *SecretsAddCommand) Synopsis() string

Synopsis returns a one-liner description for this command

type SecretsBaseCommand

type SecretsBaseCommand struct {
	*ProjectCommand
	// contains filtered or unexported fields
}

SecretsBaseCommand represents a common Atlas project-based secrets command

func NewSecretsBaseCommand

func NewSecretsBaseCommand(name, workingDirectory string, ui cli.Ui, telemetryService *telemetry.Service) *SecretsBaseCommand

NewSecretsBaseCommand returns a new *SecretsBaseCommand

func (*SecretsBaseCommand) Help

func (sbc *SecretsBaseCommand) Help() string

Help returns long-form help information for the SecretsBaseCommand command

type SecretsCommand

type SecretsCommand struct {
	*BaseCommand
}

SecretsCommand is used to run CRUD operations on a Realm App's secrets

func (*SecretsCommand) Help

func (sc *SecretsCommand) Help() string

Help returns long-form help information for this command

func (*SecretsCommand) Run

func (sc *SecretsCommand) Run(args []string) int

Run executes the command

func (*SecretsCommand) Synopsis

func (sc *SecretsCommand) Synopsis() string

Synopsis returns a one-liner description for this command

type SecretsListCommand

type SecretsListCommand struct {
	*SecretsBaseCommand
}

SecretsListCommand is used to list secrets from a Realm app

func (*SecretsListCommand) Help

func (slc *SecretsListCommand) Help() string

Help returns long-form help information for this command

func (*SecretsListCommand) Run

func (slc *SecretsListCommand) Run(args []string) int

Run executes the command

func (*SecretsListCommand) Synopsis

func (slc *SecretsListCommand) Synopsis() string

Synopsis returns a one-liner description for this command

type SecretsRemoveCommand

type SecretsRemoveCommand struct {
	*SecretsBaseCommand
	// contains filtered or unexported fields
}

SecretsRemoveCommand is used to remove secrets from a Realm app

func (*SecretsRemoveCommand) Help

func (src *SecretsRemoveCommand) Help() string

Help returns long-form help information for this command

func (*SecretsRemoveCommand) Run

func (src *SecretsRemoveCommand) Run(args []string) int

Run executes the command

func (*SecretsRemoveCommand) Synopsis

func (src *SecretsRemoveCommand) Synopsis() string

Synopsis returns a one-liner description for this command

type SecretsUpdateCommand

type SecretsUpdateCommand struct {
	*SecretsBaseCommand
	// contains filtered or unexported fields
}

SecretsUpdateCommand is used to update a secret from a Realm app

func (*SecretsUpdateCommand) Help

func (suc *SecretsUpdateCommand) Help() string

Help returns long-form help information for this command

func (*SecretsUpdateCommand) Run

func (suc *SecretsUpdateCommand) Run(args []string) int

Run executes the command

func (*SecretsUpdateCommand) Synopsis

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

Jump to

Keyboard shortcuts

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