diff --git a/.gitignore b/.gitignore index 4b69ad1..69a8060 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ *.log unittest.xml venv/ +vendor/ .idea/ main -go.sum +vendor/ diff --git a/.travis.yml b/.travis.yml index a90a55e..088d336 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,17 +5,21 @@ os: - osx go: - - "1.10" - - master + - "1.11.x" + - "1.12.x" + - "1.13.x" + +env: + - GO111MODULE=on before_install: - pip install --user -r tests/pip-req.txt install: - - go get -u golang.org/x/vgo - go get -u golang.org/x/tools/cmd/goimports - - go get -u github.com/douban/gobeansdb script: - diff <(goimports -d .) <(printf "") + - make install + - go get -u github.com/douban/gobeansdb - make test diff --git a/Makefile b/Makefile index 3c2a281..4fb8891 100644 --- a/Makefile +++ b/Makefile @@ -2,22 +2,11 @@ all:install export PYTHONPATH=. -# FIXME: When this issue is done(https://github.com/golang/go/issues/23965#issuecomment-409232583) -# Determine the compiler and version -COMPILER_HELP := $(shell $(CC) --help | head -n 1) -ifneq (,$(findstring clang,$(COMPILER_HELP))) - COMPILER = clang -else ifneq (,$(findstring gcc,$(COMPILER_HELP))) - COMPILER = gcc -else - COMPILER = unknown -endif - test: ./misc/gobeansdb_server.sh start go version - vgo test github.com/douban/gobeansproxy/config - vgo test github.com/douban/gobeansproxy/dstore + go test github.com/douban/gobeansproxy/config + go test github.com/douban/gobeansproxy/dstore ./misc/gobeansdb_server.sh stop template: @@ -28,4 +17,5 @@ pytest:install ./tests/run_test.sh install: - CC=$(COMPILER) vgo install ./ + GO111MODULE=on go mod vendor + go install ./ diff --git a/README.md b/README.md index 900b3cc..813d5ec 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,7 @@ A proxy for [Gobeansdb](https://github.com/douban/gobeansdb). ## Prepare -GoBeansProxy use `vgo` manage dependencies, please install [vgo](https://godoc.org/golang.org/x/vgo) first. -Supported Go version: 1.10.1+ +Supported Go version: > 1.11.0 ## Install @@ -24,5 +23,9 @@ $ make test # unit test ## run ``` +# Run with conf +$ ${GOPATH}/bin/proxy -confdir pathToConfDir + +# Others $ ${GOPATH}/bin/proxy -h ``` diff --git a/config/config.go b/config/config.go index b2580e7..e56e7c1 100644 --- a/config/config.go +++ b/config/config.go @@ -9,7 +9,7 @@ import ( ) const ( - Version = "1.0.0.8" + Version = "v1.0.2" ) var ( diff --git a/dstore/scheduler.go b/dstore/scheduler.go index ef53917..372e8ba 100644 --- a/dstore/scheduler.go +++ b/dstore/scheduler.go @@ -255,7 +255,7 @@ func (sch *ManualScheduler) checkFailsForBucket(bucket *Bucket) { } else { logger.Infof( "beansdb server %s in Bucket %X's Down while check fails , err is %s", - hostBucket.host.Addr, bucket, err) + hostBucket.host.Addr, bucket.ID, err) } } } diff --git a/go.mod b/go.mod index 7894a06..b22b547 100644 --- a/go.mod +++ b/go.mod @@ -2,8 +2,10 @@ module github.com/douban/gobeansproxy require ( github.com/davecgh/go-spew v1.1.0 // indirect - github.com/douban/gobeansdb v1.0.1 + github.com/douban/gobeansdb v1.1.0 github.com/pmezard/go-difflib v1.0.0 // indirect github.com/stretchr/testify v1.2.2 gopkg.in/yaml.v2 v2.2.1 ) + +go 1.13 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..89bf573 --- /dev/null +++ b/go.sum @@ -0,0 +1,15 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/douban/gobeansdb v1.1.0 h1:Ia659+3inop0LFeS8/aLFM7mEcJ0hdX0fcIGrZC1aDw= +github.com/douban/gobeansdb v1.1.0/go.mod h1:1Irour4eUljC+P/4aD6qI1z9zWao4IzQYJmfuRqcH7o= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/samuel/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec h1:6ncX5ko6B9LntYM0YBRXkiSaZMmLYeZ/NWcmeB43mMY= +github.com/samuel/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=