Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // RootCmd is the root command RootCmd = &cobra.Command{ Use: "etcdauthstrap", Short: "etcd auth config tool", Long: `A utility for configuring and enabling Auth on etcd v2 and v3 APIs`, PersistentPreRun: func(ccmd *cobra.Command, args []string) { if config != "" { absolutepath, err := filepath.Abs(config) if err != nil { log.Error("Error reading configfile path: ", err) } base := filepath.Base(absolutepath) path := filepath.Dir(absolutepath) viper.SetConfigType("toml") viper.SetConfigName(strings.Split(base, ".")[0]) viper.SetConfigFile(config) viper.AddConfigPath(path) if err := viper.ReadInConfig(); err != nil { log.Fatal("Failed to read config file: ", err.Error()) os.Exit(1) } } }, Run: func(ccmd *cobra.Command, args []string) { ccmd.HelpFunc()(ccmd, args) }, } )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.