本文整理匯總了Golang中github.com/spf13/pflag.FlagSet.Uint64P方法的典型用法代碼示例。如果您正苦於以下問題:Golang FlagSet.Uint64P方法的具體用法?Golang FlagSet.Uint64P怎麽用?Golang FlagSet.Uint64P使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/spf13/pflag.FlagSet
的用法示例。
在下文中一共展示了FlagSet.Uint64P方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: NewConfig
// NewConfig creates a new instance of Config. If a viper instance is not
// provided, a new one will be created.
func NewConfig(flagSet *flag.FlagSet, v *viper.Viper) *Config {
if flagSet == nil {
flagSet = flag.CommandLine
}
if v == nil {
v = viper.New()
}
flagSet.StringP("config_file", "c", "", "path to config file")
flagSet.StringP("service_name", "n", "", "provider service name")
flagSet.StringP("socket_dir", "s", "/tmp/mistify", "base directory in which to create task sockets")
flagSet.UintP("default_priority", "p", 50, "default task priority")
flagSet.StringP("coordinator_url", "u", "", "url of coordinator for making requests")
flagSet.StringP("log_level", "l", "warning", "log level: debug/info/warn/error/fatal/panic")
flagSet.Uint64P("request_timeout", "t", 0, "default timeout for requests made by this provider in seconds")
return &Config{
viper: v,
flagSet: flagSet,
}
}