cmds

package
v0.0.0-...-e7bfc94 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const HomeFlag = "home"

Variables

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

CronCmd ...

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

NodeCmd ...

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

NoticeCmd ...

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 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
⌂ 换网址