Documentation ¶
Index ¶
Constants ¶
const ( // SUCCESS is an alias of exit status code to ease read. SUCCESS int = 0 // FAILURE is an alias of exit status code to ease read. FAILURE int = 1 )
Variables ¶
var ( // ConfApp is the basic app settings. ConfApp = conf.TConfigFile{ PathDirConf: ".", NameFileConf: "config", NameTypeConf: "yaml", PathFileConf: ".gopress", IsUsingDefaultConf: false, } // ConfUser holds the values read from the config file. The values here are // the default. ConfUser = TConfUser{ Template: "default", } )
Functions ¶
func EchoStdErrIfError ¶
EchoStdErrIfError is an STDERR wrapper and returns 0(zero) or 1. It does nothing if the error is nil and returns 0.
func Execute ¶
func Execute() error
Execute is the main function of `cmd` package. It adds all the child commands to the root's command tree and sets their flag settings. Then runs/executes the `rootCmd` to find appropriate matches for child commands with corresponding flags and args.
Usually `cmd.Execute` will be called by the `main.main()` and it only needs to happen once to the rootCmd. Returns `error` when it fails to execute.
Types ¶
type TConfUser ¶
type TConfUser struct {
Template string `mapstructure:"template"`
}
TConfUser defines the data structure to store values from a conf file. Viper will read these values from the config file or env variables. `mapstructure` defines the key name in the conf file.
type TypePropertyInit ¶
type TypePropertyInit struct {
// contains filtered or unexported fields
}