本文整理汇总了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,
}
}