root

package
v0.6.88 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrProcessingConfigCode        = "1050"
	ErrCreatingConfigFileCode      = "1051"
	ErrAddingTokenToConfigCode     = "1052"
	ErrAddingContextToConfigCode   = "1053"
	ErrUnmarshallingConfigFileCode = "1054"
	ErrGettingRequestContextCode   = "1055"
	ErrInvalidAPIResponseCode      = "1056"
	ErrUnmarshallingAPIDataCode    = "1057"
	ErrConnectingToServerCode      = "1058"
)

Variables

View Source
var (
	ErrCreatingConfigFile = errors.New(ErrCreatingConfigFileCode, errors.Alert, []string{"Unable to create config file"}, []string{"Unable to create config file"}, []string{}, []string{})

	ErrAddingTokenToConfig = errors.New(ErrAddingTokenToConfigCode, errors.Alert, []string{"Unable to add token to config"}, []string{"Unable to add token to config"}, []string{}, []string{})

	ErrAddingContextToConfig = errors.New(ErrAddingContextToConfigCode, errors.Alert, []string{"Unable to add context to config"}, []string{"Unable to add context to config"}, []string{}, []string{})

	ErrUnmarshallingConfigFile = errors.New(ErrUnmarshallingConfigFileCode, errors.Alert, []string{"Error processing json in config file"}, []string{"Error processing json in config file"}, []string{}, []string{})
)
View Source
var RootCmd = &cobra.Command{
	Use:   "mesheryctl",
	Short: "Meshery Command Line tool",
	Long:  `As a self-service engineering platform, Meshery enables collaborative design and operation of cloud native infrastructure.`,
	Example: `
// Base command
mesheryctl

// Display help about command/subcommand
mesheryctl --help
mesheryctl system start --help

// For viewing verbose output
mesheryctl -v [or] --verbose
	`,
	RunE: func(cmd *cobra.Command, args []string) error {
		if len(args) == 0 {
			return cmd.Help()
		}

		if ok := utils.IsValidSubcommand(availableSubcommands, args[0]); !ok {
			return errors.New(utils.RootError(fmt.Sprintf("'%s' is an invalid command. Use 'mesheryctl --help' to display usage guide.\n", args[0])))
		}

		return nil
	},
}

RootCmd represents the base command when called without any subcommands

Functions

func ErrConnectingToServer added in v0.6.2

func ErrConnectingToServer(err error) error

func ErrGettingRequestContext added in v0.6.2

func ErrGettingRequestContext(err error) error

func ErrInvalidAPIResponse added in v0.6.2

func ErrInvalidAPIResponse(err error) error

func ErrProcessingConfig added in v0.6.2

func ErrProcessingConfig(err error) error

func ErrUnmarshallingAPIData added in v0.6.2

func ErrUnmarshallingAPIData(err error) error

func Execute

func Execute() error

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the RootCmd.

func TreePath added in v0.6.2

func TreePath() *cobra.Command

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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