Unverified Commit 4ede3138 authored by randy's avatar randy Committed by GitHub

Merge pull request #52 from ztelur/master

improve etcd version
parents 140d7076 a9093928
......@@ -19,7 +19,7 @@ jobs:
os:
- ubuntu-latest
go_version:
- 1.13
- 1.15
env:
DING_TOKEN: ${{ secrets.DING_TOKEN }}
DING_SIGN: ${{ secrets.DING_SIGN }}
......
language: go
go:
- "1.13.x"
- "1.15.x"
script:
- go fmt ./... && [[ -z `git status -s` ]]
......
......@@ -27,8 +27,8 @@ import (
import (
perrors "github.com/pkg/errors"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/clientv3/concurrency"
"go.etcd.io/etcd/client/v3"
"go.etcd.io/etcd/client/v3/concurrency"
"google.golang.org/grpc"
)
......@@ -458,6 +458,12 @@ func (c *Client) Update(k, v string) error {
return perrors.WithMessagef(err, "Update k/v (key: %s value %s)", k, v)
}
// Put key value ...
func (c *Client) Put(k, v string, opts ...clientv3.OpOption) error {
err := c.put(k, v, opts...)
return perrors.WithMessagef(err, "Put k/v (key: %s value %s)", k, v)
}
// Update key value ...
func (c *Client) UpdateWithRev(k, v string, rev int64, opts ...clientv3.OpOption) error {
err := c.updateWithRev(k, v, rev, opts...)
......
......@@ -31,8 +31,8 @@ import (
perrors "github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
"go.etcd.io/etcd/embed"
"go.etcd.io/etcd/mvcc/mvccpb"
"go.etcd.io/etcd/api/v3/mvccpb"
"go.etcd.io/etcd/server/v3/embed"
"google.golang.org/grpc/connectivity"
)
......@@ -294,7 +294,7 @@ func (suite *ClientTestSuite) TestClientDeleteKV() {
v := tc.input.v
expect := ErrKVPairNotFound
if err := c.Create(k, v); err != nil {
if err := c.Put(k, v); err != nil {
t.Fatal(err)
}
......
......@@ -2,22 +2,13 @@ module github.com/dubbogo/gost
require (
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/davecgh/go-spew v1.1.1
github.com/dubbogo/go-zookeeper v1.0.3
github.com/dubbogo/jsonparser v1.0.1
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/google/uuid v1.2.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.14.6 // indirect
github.com/jonboulle/clockwork v0.2.2 // indirect
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 // indirect
github.com/k0kubun/pp v3.0.1+incompatible
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-colorable v0.1.7 // indirect
github.com/mattn/go-isatty v0.0.12
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
......@@ -26,16 +17,16 @@ require (
github.com/shirou/gopsutil v3.20.11+incompatible
github.com/stretchr/testify v1.7.0
github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 // indirect
go.etcd.io/etcd v0.0.0-20200402134248-51bdeb39e698
go.etcd.io/etcd/api/v3 v3.5.0-alpha.0
go.etcd.io/etcd/client/v3 v3.5.0-alpha.0
go.etcd.io/etcd/server/v3 v3.5.0-alpha.0
go.uber.org/atomic v1.7.0
go.uber.org/zap v1.16.0 // indirect
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/sys v0.0.0-20201223074533-0d417f636930 // indirect
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 // indirect
google.golang.org/grpc v1.29.1
google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98 // indirect
google.golang.org/grpc v1.36.0
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)
go 1.13
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment