add argv.URL
This commit is contained in:
parent
22d49578c9
commit
66dc8d1f61
5
Makefile
5
Makefile
|
@ -11,7 +11,7 @@ all: build
|
||||||
./zood --version
|
./zood --version
|
||||||
./zood
|
./zood
|
||||||
|
|
||||||
build:
|
build: goimports
|
||||||
GO111MODULE=off go build \
|
GO111MODULE=off go build \
|
||||||
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
||||||
|
|
||||||
|
@ -45,3 +45,6 @@ git-clone:
|
||||||
|
|
||||||
http-list-packages:
|
http-list-packages:
|
||||||
curl --silent http://localhost:2521/list?hostname=zookeeper.wit.com
|
curl --silent http://localhost:2521/list?hostname=zookeeper.wit.com
|
||||||
|
|
||||||
|
localhost:
|
||||||
|
./zood --port 2232 --url "http://localhost:2233"
|
||||||
|
|
5
argv.go
5
argv.go
|
@ -13,8 +13,9 @@ import (
|
||||||
var argv args
|
var argv args
|
||||||
|
|
||||||
type args struct {
|
type args struct {
|
||||||
Daemon bool `arg:"--daemon" default:"false" help:"run in daemon mode"`
|
Daemon bool `arg:"--daemon" default:"false" help:"run in daemon mode"`
|
||||||
Port int `arg:"--port" default:"2521" help:"port to run on"`
|
Port int `arg:"--port" default:"2521" help:"port to run on"`
|
||||||
|
URL string `arg:"--url" default:"2521" help:"url to use"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (args) Version() string {
|
func (args) Version() string {
|
||||||
|
|
3
main.go
3
main.go
|
@ -33,6 +33,9 @@ func main() {
|
||||||
|
|
||||||
me = new(stuff)
|
me = new(stuff)
|
||||||
me.urlbase = "http://zookeeper.grid.wit.com:8080"
|
me.urlbase = "http://zookeeper.grid.wit.com:8080"
|
||||||
|
if argv.URL != "" {
|
||||||
|
me.urlbase = argv.URL
|
||||||
|
}
|
||||||
|
|
||||||
me.pollDelay = 3 * time.Second
|
me.pollDelay = 3 * time.Second
|
||||||
me.failcountmax = 20 // die every minute if zookeeper can't be found
|
me.failcountmax = 20 // die every minute if zookeeper can't be found
|
||||||
|
|
Loading…
Reference in New Issue