root

package
v0.4.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Build - holds the build info of Client
	Build string

	// CommitSHA - holds the Git-SHA info
	CommitSHA string
)
View Source
var RootCmd = &cobra.Command{
	Use:   "mesheryctl",
	Short: "Meshery Command Line tool",
	Long:  `Meshery is the service mesh management plane, providing lifecycle, performance, and configuration management of service meshes and their workloads.`,
	Args:  cobra.MinimumNArgs(1),

	PreRunE: func(cmd *cobra.Command, args []string) error {
		if ok := utils.IsValidSubcommand(availableSubcommands, args[0]); !ok {
			return errors.New(utils.RootError(fmt.Sprintf("invalid command: \"%s\"", args[0])))
		}
		return nil
	},
	RunE: func(cmd *cobra.Command, args []string) error {
		b, err := cmd.Flags().GetBool("version")
		if err != nil {
			return err
		}

		if b {
			versionCmd.Run(nil, nil)
			return nil
		}

		return nil
	},
}

RootCmd represents the base command when called without any subcommands

Functions

func Execute

func Execute()

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.

Types

type TerminalFormatter

type TerminalFormatter struct{}

TerminalFormatter is exported

func (*TerminalFormatter) Format

func (f *TerminalFormatter) Format(entry *log.Entry) ([]byte, error)

Format is exported

type Version added in v0.3.18

type Version struct {
	Build     string `json:"build,omitempty"`
	CommitSHA string `json:"commitsha,omitempty"`
}

Version unmarshals the json response from the server's version api

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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