cmds

package
v0.0.0-...-608bfbb Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const HomeFlag = "home"

Variables

View Source
var ProxyCmd = &cobra.Command{
	Use:   "proxy",
	Short: "kake proxy",
	Run: func(cmd *cobra.Command, args []string) {
	},
}

ProxyCmd ...

View Source
var RootCmd = &cobra.Command{
	Use:     "kake",
	Short:   "kake app",
	Version: version.Version,
	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
		return assert.KTry(func() {
			cfg := config.DefaultConfig()
			assert.ErrWrap(viper.Unmarshal(cfg.Cfg), "config init error")
		})
	},
}
View Source
var ServiceCmd = &cobra.Command{
	Use:     "s",
	Aliases: []string{"s"},
	Short:   "kake service",
	Run: func(cmd *cobra.Command, args []string) {
	},
}

ServiceCmd ...

View Source
var VersionCmd = &cobra.Command{
	Use:     "version",
	Aliases: []string{"v"},
	Short:   "Show version info",
	Run: func(cmd *cobra.Command, args []string) {
		log.Println("version", version.Version)
		log.Println("commit version", version.CommitV)
		log.Println("build version", version.BuildV)
	},
}

VersionCmd ...

View Source
var WebCmd = &cobra.Command{
	Use:   "web",
	Short: "kake web",
	Run: func(cmd *cobra.Command, args []string) {
	},
}

WebCmd ...

Functions

This section is empty.

Types

type Executor

type Executor struct {
	*cobra.Command
	Exit func(int) // this is os.Exit by default, override in tests
}

Executor wraps the cobra Command with a nicer Execute method

func PrepareBaseCmd

func PrepareBaseCmd(cmd *cobra.Command, envPrefix, defaultHome string) Executor

func (Executor) Execute

func (e Executor) Execute() error

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

type ExitCoder

type ExitCoder interface {
	ExitCode() int
}

Jump to

Keyboard shortcuts

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