Documentation
¶
Index ¶
- Variables
- func ExecuteContext(ctx context.Context, rootCmd *cobra.Command, clients *shared.ClientFactory)
- func Init(ctx context.Context) (*cobra.Command, *shared.ClientFactory)
- func InitConfig(ctx context.Context, clients *shared.ClientFactory, rootCmd *cobra.Command) error
- func NewRootCommand(clients *shared.ClientFactory, updateNotification *update.UpdateNotification) *cobra.Command
- type AliasInfo
Constants ¶
This section is empty.
Variables ¶
var AliasMap = map[string]*AliasInfo{ "activity": {CommandFactory: platform.NewActivityCommand, CanonicalName: "platform activity", ParentName: "platform"}, "create": {CommandFactory: project.NewCreateCommand, CanonicalName: "project create", ParentName: "project"}, "delete": {CommandFactory: app.NewDeleteCommand, CanonicalName: "app delete", ParentName: "app"}, "deploy": {CommandFactory: platform.NewDeployCommand, CanonicalName: "platform deploy", ParentName: "platform"}, "init": {CommandFactory: project.NewInitCommand, CanonicalName: "project init", ParentName: "project"}, "install": {CommandFactory: app.NewAddCommand, CanonicalName: "app install", ParentName: "app"}, "list": {CommandFactory: auth.NewListCommand, CanonicalName: "auth list", ParentName: "auth"}, "login": {CommandFactory: auth.NewLoginCommand, CanonicalName: "auth login", ParentName: "auth"}, "logout": {CommandFactory: auth.NewLogoutCommand, CanonicalName: "auth logout", ParentName: "auth"}, "run": {CommandFactory: platform.NewRunCommand, CanonicalName: "platform run", ParentName: "platform"}, "samples": {CommandFactory: project.NewSamplesCommand, CanonicalName: "project samples", ParentName: "project"}, "uninstall": {CommandFactory: app.NewUninstallCommand, CanonicalName: "app uninstall", ParentName: "app"}, }
Functions ¶
func ExecuteContext ¶
ExecuteContext sets up a cancellable context for use with IOStreams' interrupt channel. It listens for process interrupts and sends to IOStreams' GetInterruptChannel() for use in in communicating process interrupts elsewhere in the code.
func Init ¶
Init bootstraps the CLI process. Put things that do not rely on specific arguments or flags passed to the CLI in here. If you need flag/argument values, InitConfig below.
func InitConfig ¶
InitConfig reads in config files and ENV variables if set and sets up the CLI for functioning. Executes _before_ any Pre* methods from the root or child commands, but after Cobra parses flags and command arguments. Put global CLI initialization routines that rely on flag and argument parsing in here please! TODO: consider using arguments for this function for certain dependencies, like working directory and other OS-specific strings, that OnInitialize above can provide during actual execution, but that we can override with test values for easier testing.
func NewRootCommand ¶
func NewRootCommand(clients *shared.ClientFactory, updateNotification *update.UpdateNotification) *cobra.Command