本文整理汇总了Golang中flag.Uint64Var函数的典型用法代码示例。如果您正苦于以下问题:Golang Uint64Var函数的具体用法?Golang Uint64Var怎么用?Golang Uint64Var使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Uint64Var函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: init
func init() {
var b bytes.Buffer
for name, s := range scalerByName {
if s == vibrant.DefaultScaler {
scalerName = name
}
if b.Len() > 0 {
b.WriteString(", ")
}
b.WriteString(name)
}
availableScalers := b.String()
flag.StringVar(&outputFile, "outputFile", "", "Output location for a quantized version of the image.")
flag.StringVar(&outputFile, "o", outputFile, "Output location for a quantized version of the image.")
flag.Uint64Var(&maximumColorCount, "maximumColorCount", maximumColorCount, "Maximum color count.")
flag.Uint64Var(&maximumColorCount, "m", maximumColorCount, "Maximum color count.")
flag.Uint64Var(&resizeImageArea, "resizeImageArea", resizeImageArea, "Resize image area.")
flag.Uint64Var(&resizeImageArea, "r", resizeImageArea, "Resize image area.")
flag.BoolVar(&debug, "debug", debug, "Debug mode.")
flag.BoolVar(&debug, "d", debug, "Debug mode.")
flag.StringVar(&scalerName, "scaler", scalerName, "Scaler. One of: "+availableScalers)
flag.StringVar(&scalerName, "s", scalerName, "Scaler. One of: "+availableScalers)
flag.Parse()
inputFile = flag.Arg(0)
}
开发者ID:RobCherry,项目名称:vibrant,代码行数:32,代码来源:main.go
示例2: registerFlags
func registerFlags() {
flag.StringVar(&addressVersion, "address-version", addressVersion,
"Network address version. Options are \"test\" and \"main\"")
// Input files
flag.StringVar(&blockchainFile, "blockchain", blockchainFile,
"Location of the blockchain file")
// Output files
flag.StringVar(&transactionFileOut, "transaction-out", transactionFileOut,
"Where to write the created transaction, if not committing to the "+
"blockchain")
// Ownership parameters. Some of these are mutually exclusive
flag.StringVar(&srcWallet, "src-wallet", srcWallet,
"Use this wallet as the spender")
flag.IntVar(&srcWalletEntry, "src-wallet-entry", srcWalletEntry,
"Only spend from this entry in the wallet. -1 means use all.")
flag.StringVar(&srcSecretKey, "src-secret", srcSecretKey,
"Spend from this secret key")
// Spending destination
flag.StringVar(&destAddress, "dest", destAddress,
"Which address to send the coins to")
// Spending amount options
flag.Uint64Var(&spendCoins, "coins", spendCoins, "How many coins to spend")
flag.Uint64Var(&spendHours, "hours", spendHours, "How many hours to spend")
flag.Uint64Var(&spendFee, "fee", spendFee,
"How much to pay in fee above the minimum fee")
flag.Uint64Var(&burnFactor, "burn", burnFactor,
"How many hours must be spent as a minimum fee, calculated as the "+
"number of output hours divided by this number. 0 is no burn.")
}
开发者ID:JmAbuDabi,项目名称:skycoin,代码行数:34,代码来源:spend.go
示例3: FlagsParse
func FlagsParse() {
flag.StringVar(&Port, "port", "50000", "node port")
flag.StringVar(&Host, "host", "127.0.0.1", "node address")
flag.Uint64Var(&MinWorkers, "minWorkers", 2, "min workers")
flag.Uint64Var(&MinPartitionsPerWorker, "ppw", 1, "min partitions per worker")
flag.Int64Var(&MessageThreshold, "mthresh", 1000, "message threshold")
flag.Int64Var(&VertexThreshold, "vthresh", 1000, "vertex threshold")
flag.StringVar(&LoadPath, "loadPath", "data", "data load path")
flag.StringVar(&PersistPath, "persistPath", "persist", "data persist path")
flag.Parse()
}
开发者ID:dforsyth,项目名称:syrup,代码行数:12,代码来源:setup.go
示例4: main
//============================================================================
// main : Entry point.
//----------------------------------------------------------------------------
func main() {
var dwarfData *dwarf.Data
var theFile *macho.File
var theErr os.Error
var relativeAddress uint64
var runtimeAddress uint64
var loadAddress uint64
var segmentAddress uint64
var pathMacho string
var pathDsym string
// Parse our arguments
flag.Uint64Var(&runtimeAddress, "raddr", 0, "")
flag.Uint64Var(&loadAddress, "laddr", 0, "")
flag.StringVar(&pathMacho, "macho", "", "")
flag.StringVar(&pathDsym, "dsym", "", "")
flag.Parse()
if runtimeAddress == 0 || loadAddress == 0 || pathMacho == "" || pathDsym == "" {
printHelp()
}
// Find the text segment address
theFile, theErr = macho.Open(pathMacho)
if theErr != nil {
fatalError("Can't open Mach-O file: " + theErr.String())
}
segmentAddress = theFile.Segment("__TEXT").Addr
theFile.Close()
// Calculate the target address
relativeAddress = runtimeAddress - loadAddress
gTargetAddress = segmentAddress + relativeAddress
// Find the target
theFile, theErr = macho.Open(pathDsym)
if theErr != nil {
fatalError("Can't open .dsym file: " + theErr.String())
}
dwarfData, theErr = theFile.DWARF()
if theErr != nil {
fatalError("Can't find DWARF info: " + theErr.String())
}
processChildren(dwarfData.Reader(), 0, false)
theFile.Close()
}
开发者ID:refnum,项目名称:gatos,代码行数:55,代码来源:gatos.go
示例5: init
func init() {
flag.Uint64Var(&CmdlineOptions.SpoolSize, "spool-size", CmdlineOptions.SpoolSize, "event count spool threshold - forces network flush")
flag.Uint64Var(&CmdlineOptions.SpoolSize, "sv", CmdlineOptions.SpoolSize, "event count spool threshold - forces network flush")
flag.IntVar(&CmdlineOptions.HarvesterBufferSize, "harvest-buffer-size", CmdlineOptions.HarvesterBufferSize, "harvester reader buffer size")
flag.IntVar(&CmdlineOptions.HarvesterBufferSize, "hb", CmdlineOptions.HarvesterBufferSize, "harvester reader buffer size")
flag.BoolVar(&CmdlineOptions.TailOnRotate, "tail", CmdlineOptions.TailOnRotate, "always tail on log rotation -note: may skip entries ")
flag.BoolVar(&CmdlineOptions.TailOnRotate, "t", CmdlineOptions.TailOnRotate, "always tail on log rotation -note: may skip entries ")
flag.BoolVar(&CmdlineOptions.Quiet, "quiet", CmdlineOptions.Quiet, "operate in quiet mode - only emit errors to log")
}
开发者ID:peterrosell,项目名称:filebeat,代码行数:13,代码来源:config.go
示例6: init
func init() {
flag.StringVar(&hostname, "hostname", "localhost:9092", "host:port string for the kafka server")
flag.StringVar(&topic, "topic", "test", "topic to publish to")
flag.StringVar(&partitionstr, "partitions", "0", "partitions to publish to: comma delimited")
flag.Uint64Var(&offset, "offset", 0, "offset to start consuming from")
flag.UintVar(&maxSize, "maxsize", 1048576, "max size in bytes to consume a message set")
flag.Uint64Var(&maxMsgCt, "msgct", math.MaxUint64, "max number of messages to read")
flag.StringVar(&writePayloadsTo, "writeto", "", "write payloads to this file")
flag.BoolVar(&consumerForever, "consumeforever", true, "loop forever consuming")
flag.BoolVar(&printmessage, "print", true, "print the message details to stdout")
log.SetOutput(os.Stdout)
log.SetFlags(log.Ltime | log.Lshortfile)
}
开发者ID:araddon,项目名称:kafka,代码行数:13,代码来源:consumer.go
示例7: init
func init() {
runtime.GOMAXPROCS(runtime.NumCPU())
flag.StringVar(&common.URL, "url", "127.0.0.1:80", "<ipaddress:port> | default 127.0.0.1:80")
flag.StringVar(&common.METHOD, "method", "GET", "<GET | POST | PUT | HEAD | PATCH | DELETE | OPTIONS | TRACE | CONNECT> | default GET")
flag.StringVar(&common.HEADER, "header", "", "<'key: value, key: value'> | default none")
flag.StringVar(&common.COOKIE, "cookie", "", "<'name=value;name=value'> | default none")
flag.StringVar(&common.DATA, "data", "", "<'name=value;name=value'> | default none")
flag.Uint64Var(&common.VCLIENT, "client", 10, "default 10")
flag.Uint64Var(&common.VCLICK, "click", 10, "default 10")
flag.Parse()
}
开发者ID:zhutao,项目名称:httpflash,代码行数:14,代码来源:main.go
示例8: main
/**
* https://projecteuler.net/problem=3
*/
func main() {
var natural_number uint64
var largestPrimeFactor uint64
flag.BoolVar(&debug, "debug", false, "Display verbose info")
flag.Uint64Var(&natural_number, "number", uint64(0), "A number to find factors for")
// now that all flags have been assigned, we can parse the CLI parameters
flag.Parse()
// make sure the CLI input is acceptable; if not error out with a helpful usage message
if natural_number < uint64(1) {
fmt.Println("You must pass in a number to factorize (Unsigned 64 integer)")
return
} else {
if debug {
fmt.Printf("factorizing this term: %d\n", natural_number)
}
}
largestPrimeFactor = LargestPrimeFactor(natural_number)
// spit out the answer.
fmt.Printf("%d\n", largestPrimeFactor)
return
}
开发者ID:carbonphyber,项目名称:djw_learning_golang,代码行数:29,代码来源:main.go
示例9: init
func init() {
flag.StringVar(&options.CPUProfile, "cpuprofile", "", "write cpu profile to file")
flag.Uint64Var(&options.SpoolSize, "spool-size", 1024,
"Maximum number of events to spool before a flush is forced.")
flag.IntVar(&options.NumWorkers, "num-workers", 1,
"deprecated option, strictly for backwards compatibility. does nothing.")
flag.DurationVar(&options.IdleTimeout, "idle-flush-time", 5*time.Second,
"Maximum time to wait for a full spool before flushing anyway")
flag.StringVar(&options.ConfigFile, "config", "", "The config file to load")
flag.StringVar(&options.LogFile, "log-file", "", "Log file output")
flag.StringVar(&options.PidFile, "pid-file", "lumberjack.pid",
"destination to which a pidfile will be written")
flag.BoolVar(&options.UseSyslog, "log-to-syslog", false,
"Log to syslog instead of stdout. This option overrides the --log-file option.")
flag.BoolVar(&options.FromBeginning, "from-beginning", false,
"Read new files from the beginning, instead of the end")
flag.StringVar(&options.HistoryPath, "progress-file", ".lumberjack",
"path of file used to store progress data")
flag.StringVar(&options.TempDir, "temp-dir", "/tmp",
"directory for creating temp files")
flag.IntVar(&options.NumThreads, "threads", 1, "Number of OS threads to use")
flag.IntVar(&options.CmdPort, "cmd-port", 42586, "tcp command port number")
flag.StringVar(&options.HttpPort, "http", "",
"http port for debug info. No http server is run if this is left off. E.g.: http=:6060")
}
开发者ID:postfix,项目名称:logstash-forwarder,代码行数:25,代码来源:options.go
示例10: init
func init() {
DefaultEnvironment = Environment{}
flag.StringVar(&DefaultEnvironment.Port, "port", "", "The microservice port.")
flag.StringVar(&DefaultEnvironment.Host, "host", "", "The microservice host.")
flag.Uint64Var(&DefaultEnvironment.Frequency, "frequency", 10, "The frequency at which the service updates statuses.")
flag.StringVar(&DefaultEnvironment.IntServiceURL, "int", "", "The internal service to service url.")
}
开发者ID:lucmichalski,项目名称:microservice,代码行数:7,代码来源:environment.go
示例11: main
func main() {
config := config.Load()
var chainID string
var serverAddr string
var windowSize uint64
flag.StringVar(&serverAddr, "server", fmt.Sprintf("%s:%d", config.General.ListenAddress, config.General.ListenPort), "The RPC server to connect to.")
flag.StringVar(&chainID, "chainID", provisional.TestChainID, "The chain ID to deliver from.")
flag.Uint64Var(&windowSize, "windowSize", 10, "The window size for the deliver.")
flag.Parse()
conn, err := grpc.Dial(serverAddr, grpc.WithInsecure())
if err != nil {
fmt.Println("Error connecting:", err)
return
}
client, err := ab.NewAtomicBroadcastClient(conn).Deliver(context.TODO())
if err != nil {
fmt.Println("Error connecting:", err)
return
}
s := newDeliverClient(client, chainID, windowSize)
s.seekOldest()
s.readUntilClose()
}
开发者ID:hyperledger,项目名称:fabric,代码行数:28,代码来源:client.go
示例12: main
func main() {
flag.StringVar(&addr, "addr", "127.0.0.1:80", "bitcask http listen addr")
flag.StringVar(&storagePath, "s", "bitcaskStorage", "data storage path")
flag.Uint64Var(&maxSize, "ms", 1<<32, "single data file maxsize")
flag.IntVar(&logLevel, "l", 0, "logger level")
flag.Parse()
logger.SetLevel(1)
opts := &bitcask.Options{
MaxFileSize: maxSize,
}
var err error
bc, err = bitcask.Open(storagePath, opts)
if err != nil {
logger.Fatal(err)
}
defer bc.Close()
defer func() {
if err := recover(); err != nil {
logger.Error(err)
debug.PrintStack()
}
}()
r := mux.NewRouter()
r.HandleFunc("/{key}", bitcaskGetHandle).Methods("GET")
r.HandleFunc("/{key}", bitcaskDelHandle).Methods("DELETE")
r.HandleFunc("/{key}", bitcaskPutHandle).Methods("POST")
logger.Info("bitcask server listen:", addr)
if err := http.ListenAndServe(addr, r); err != nil {
logger.Error(err)
}
}
开发者ID:laohanlinux,项目名称:bitcask,代码行数:34,代码来源:bitcaskhttp.go
示例13: main
func main() {
log.SetFlags(log.LstdFlags | log.Lshortfile)
flag.IntVar(&cfg.Port, "port", 9033, "port to listen on")
flag.StringVar(&cfg.DataBasePath, "data", "/tmp/qrpc", "directory in which queue data is stored")
flag.Uint64Var(&cfg.MaxCacheSize, "cache", 1024*1024, "max. cache size (bytes) before an item is evicted.")
flag.DurationVar(&cfg.ClusterRequestTimeout, "timeout", 3*time.Second, "cluster request (gossip) timeout.")
flag.DurationVar(&cfg.ClusterWatchInterval, "interval", time.Second, "cluster watch timer interval.")
flag.Usage = func() {
fmt.Fprintf(os.Stderr, "usage: %s [flags] [cluster peer(s) ...]\n", os.Args[0])
fmt.Fprintln(os.Stderr, "flags:")
flag.PrintDefaults()
os.Exit(2)
}
flag.Parse()
cfg.ClusterPeers = flag.Args()
s := qrpc.NewServer(&cfg)
errchan := s.Start()
// Handle SIGINT and SIGTERM.
sigchan := make(chan os.Signal, 1)
signal.Notify(sigchan, os.Interrupt, os.Kill)
select {
case sig := <-sigchan:
log.Printf("Signal %s received, shutting down...\n", sig)
s.Stop()
case err := <-errchan:
log.Fatalln(err)
}
}
开发者ID:kuba--,项目名称:qrpc,代码行数:33,代码来源:qrpc.go
示例14: init
func init() {
flag.StringVar(&colorScheme, "color", "heat", "how to render the magnitudes (grayscale, rainbow)")
flag.StringVar(&scaleType, "scale", "linear", "the scale to use for the x/value axis (linear, logarithmic, exponential)")
flag.Float64Var(&maximumValue, "maximum", 0, "allows you to specify the expected maximum value to avoid rendering interruptions")
flag.Uint64Var(&maximumMagnitude, "magnitude", 0, "allows you to specify the expected maximum magnitude value (i.e. frequency, which depends on the width of the summarisation buckets) to avoid rendering interruptions")
flag.UintVar(&msBetweenSamples, "sample-period-ms", defaultMsBetweenSamples, "controls the minimum amount of milliseconds between samples")
flag.Parse()
switch colorScheme {
case "grayscale":
colorScale = grayScale
case "rainbow":
colorScale = rainbowScale
case "heat":
colorScale = heatScale
default:
fmt.Fprintln(os.Stderr, "Did not recognise color scheme specified. Must be one of grayscale, rainbow, heat")
os.Exit(1)
}
switch scaleType {
case "logarithmic":
scale = logarithmicScale // higher resolution of higher numbers
reverseScale = reverseLogarithmicScale
case "exponential":
scale = exponentialScale // higher resolution of small numbers
reverseScale = reverseExponentialScale
case "linear":
scale = linearScale // uniform resolution
reverseScale = reverseLinearScale
default:
fmt.Fprintln(os.Stderr, "Did not recognise scale provided. Must be one of linear, logarithmic, exponential")
os.Exit(2)
}
}
开发者ID:mrmanc,项目名称:spectro,代码行数:35,代码来源:spectro.go
示例15: init
func init() {
flag.StringVar(&sourceURL, "u", "", "the url you wish to download from")
flag.StringVar(&remoteFile, "r", "", "the remote filename to download")
flag.StringVar(&localFile, "o", "", "the output filename")
flag.IntVar(&timeout, "t", 5, "timeout, in seconds")
flag.BoolVar(&verbose, "v", false, "verbose")
flag.BoolVar(&showFiles, "l", false, "list files in zip")
flag.Uint64Var(&limitBytes, "b", 0, "limit filesize downloaded (in bytes)")
flag.Parse()
if sourceURL == "" {
fmt.Println("You must specify a URL")
flag.PrintDefaults()
os.Exit(1)
}
if !showFiles {
if remoteFile == "" {
fmt.Println("You must specify a remote filename")
flag.PrintDefaults()
os.Exit(1)
}
if localFile == "" {
_, localFile = filepath.Split(remoteFile)
}
}
}
开发者ID:cj123,项目名称:rover,代码行数:29,代码来源:main.go
示例16: New
// Builds a conf data structure and connects
// the fields in the struct to flags.
// It is up to the caller to call flag.Parse()
func New() *D {
d := new(D)
flag.BoolVar(&d.PrintVersion, "version", false,
"Print l2met version and sha.")
flag.StringVar(&d.AppName, "app-name", "l2met",
"Prefix internal log messages with this value.")
flag.IntVar(&d.BufferSize, "buffer", 1024,
"Max number of items for all internal buffers.")
flag.IntVar(&d.Concurrency, "concurrency", 10,
"Number of running go routines for outlet or receiver.")
flag.IntVar(&d.Port, "port", 8080,
"HTTP server's bind port.")
flag.IntVar(&d.OutletRetries, "outlet-retry", 2,
"Number of attempts to outlet metrics to Librato.")
flag.Int64Var(&d.ReceiverDeadline, "recv-deadline", 2,
"Number of time units to pass before dropping incoming logs.")
flag.DurationVar(&d.OutletTtl, "outlet-ttl", time.Second*2,
"Timeout set on Librato HTTP requests.")
flag.Uint64Var(&d.MaxPartitions, "partitions", uint64(1),
"Number of partitions to use for outlets.")
flag.DurationVar(&d.FlushInterval, "flush-interval", time.Second,
"Time to wait before sending data to store or outlet. "+
"Example:60s 30s 1m")
flag.DurationVar(&d.OutletInterval, "outlet-interval", time.Second,
"Time to wait before outlets read buckets from the store. "+
"Example:60s 30s 1m")
flag.BoolVar(&d.UseOutlet, "outlet", false,
"Start the Librato outlet.")
flag.BoolVar(&d.UsingReciever, "receiver", false,
"Enable the Receiver.")
flag.BoolVar(&d.Verbose, "v", false,
"Enable verbose log output.")
d.RedisHost, d.RedisPass, _ = parseRedisUrl(env("REDIS_URL"))
d.Secrets = strings.Split(mustenv("SECRETS"), ":")
if len(env("METCHAN_URL")) > 0 {
url, err := url.Parse(env("METCHAN_URL"))
if err == nil {
d.MetchanUrl = url
}
}
return d
}
开发者ID:ryandotsmith,项目名称:l2met,代码行数:62,代码来源:conf.go
示例17: RegisterCmdlineUint64Var
func RegisterCmdlineUint64Var(dest *uint64, opt string, def uint64, desc string) bool {
if flag.Parsed() {
return false
}
flag.Uint64Var(dest, opt, def, desc)
return true
}
开发者ID:hqr,项目名称:surge,代码行数:8,代码来源:config.go
示例18: init
func init() {
flag.Uint64Var(&users, "u", 10, "concurrent users.")
flag.StringVar(&timeout, "t", "30s",
"duration for performing transactions. Use s, m, h modifiers")
flag.StringVar(&output, "o", "", "output file for summary")
flag.StringVar(&configfile, "c", "conquest.js", "conquest js file path")
flag.BoolVar(&sequential, "s", false, "do transactions in sequential mode")
flag.BoolVar(&verbose, "v", false, "print failed requests")
}
开发者ID:rizqi101,项目名称:conquest,代码行数:9,代码来源:main.go
示例19: Flag
// Defines flags to configure an application.
func Flag(name string) App {
app := &app{}
flag.Uint64Var(&app.id, name+".id", 0, "Facebook application ID.")
flag.StringVar(
&app.secret, name+".secret", "", "Facebook application secret.")
flag.StringVar(
&app.namespace, name+".namespace", "", "Facebook application namespace.")
return app
}
开发者ID:stoyan,项目名称:rell,代码行数:10,代码来源:fbapp.go
示例20: init
func init() {
flag.StringVar(&hostname, "hostname", "localhost:9092", "host:port string for the kafka server")
flag.StringVar(&topic, "topic", "test", "topic to publish to")
flag.IntVar(&partition, "partition", 0, "partition to publish to")
flag.Uint64Var(&offset, "offset", 0, "offset to start consuming from")
flag.UintVar(&maxSize, "maxsize", 1048576, "max size in bytes of message set to request")
flag.StringVar(&writePayloadsTo, "writeto", "", "write payloads to this file")
flag.BoolVar(&consumerForever, "consumeforever", false, "loop forever consuming")
flag.BoolVar(&printmessage, "printmessage", true, "print the message details to stdout")
}
开发者ID:QiuYe,项目名称:kafka.go,代码行数:10,代码来源:consumer.go
注:本文中的flag.Uint64Var函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论