Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gostnops
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wei.xuan
gostnops
Commits
4ede3138
Unverified
Commit
4ede3138
authored
May 15, 2021
by
randy
Committed by
GitHub
May 15, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #52 from ztelur/master
improve etcd version
parents
140d7076
a9093928
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
197 additions
and
31 deletions
+197
-31
github-actions.yml
.github/workflows/github-actions.yml
+1
-1
.travis.yml
.travis.yml
+1
-1
client.go
database/kv/etcd/v3/client.go
+8
-2
client_test.go
database/kv/etcd/v3/client_test.go
+3
-3
go.mod
go.mod
+5
-14
go.sum
go.sum
+179
-10
No files found.
.github/workflows/github-actions.yml
View file @
4ede3138
...
...
@@ -19,7 +19,7 @@ jobs:
os
:
-
ubuntu-latest
go_version
:
-
1.1
3
-
1.1
5
env
:
DING_TOKEN
:
${{ secrets.DING_TOKEN }}
DING_SIGN
:
${{ secrets.DING_SIGN }}
...
...
.travis.yml
View file @
4ede3138
language
:
go
go
:
-
"
1.1
3
.x"
-
"
1.1
5
.x"
script
:
-
go fmt ./... && [[ -z `git status -s` ]]
...
...
database/kv/etcd/v3/client.go
View file @
4ede3138
...
...
@@ -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
...
)
...
...
database/kv/etcd/v3/client_test.go
View file @
4ede3138
...
...
@@ -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
)
}
...
...
go.mod
View file @
4ede3138
...
...
@@ -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
go.sum
View file @
4ede3138
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment