-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.go
45 lines (35 loc) · 1.41 KB
/
options.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package nsqadmin
import (
"log"
"os"
"time"
)
type Options struct {
HTTPAddress string `flag:"http-address"`
GraphiteURL string `flag:"graphite-url"`
ProxyGraphite bool `flag:"proxy-graphite"`
UseStatsdPrefixes bool `flag:"use-statsd-prefixes"`
StatsdPrefix string `flag:"statsd-prefix"`
StatsdCounterFormat string `flag:"statsd-counter-format"`
StatsdGaugeFormat string `flag:"statsd-gauge-format"`
StatsdInterval time.Duration `flag:"statsd-interval"`
NSQLookupdHTTPAddresses []string `flag:"lookupd-http-address" cfg:"nsqlookupd_http_addresses"`
NSQDHTTPAddresses []string `flag:"nsqd-http-address" cfg:"nsqd_http_addresses"`
HTTPClientTLSInsecureSkipVerify bool `flag:"http-client-tls-insecure-skip-verify"`
HTTPClientTLSRootCAFile string `flag:"http-client-tls-root-ca-file"`
HTTPClientTLSCert string `flag:"http-client-tls-cert"`
HTTPClientTLSKey string `flag:"http-client-tls-key"`
NotificationHTTPEndpoint string `flag:"notification-http-endpoint"`
Logger logger
}
func NewOptions() *Options {
return &Options{
HTTPAddress: "0.0.0.0:4171",
UseStatsdPrefixes: true,
StatsdPrefix: "nsq.%s",
StatsdCounterFormat: "stats.counters.%s.count",
StatsdGaugeFormat: "stats.gauges.%s",
StatsdInterval: 60 * time.Second,
Logger: log.New(os.Stderr, "[nsqadmin] ", log.Ldate|log.Ltime|log.Lmicroseconds),
}
}