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
766406c4
Commit
766406c4
authored
Feb 16, 2021
by
ztelur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GetRawClient to getRawClient
parent
fa667d37
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
client.go
database/kv/etcd/v3/client.go
+10
-10
No files found.
database/kv/etcd/v3/client.go
View file @
766406c4
...
...
@@ -194,7 +194,7 @@ func (c *Client) keepSessionLoop(s *concurrency.Session) {
}
}
func
(
c
*
Client
)
G
etRawClient
()
*
clientv3
.
Client
{
func
(
c
*
Client
)
g
etRawClient
()
*
clientv3
.
Client
{
c
.
lock
.
RLock
()
defer
c
.
lock
.
RUnlock
()
...
...
@@ -203,7 +203,7 @@ func (c *Client) GetRawClient() *clientv3.Client {
// if k not exist will put k/v in etcd, otherwise return nil
func
(
c
*
Client
)
put
(
k
string
,
v
string
,
opts
...
clientv3
.
OpOption
)
error
{
rawClient
:=
c
.
G
etRawClient
()
rawClient
:=
c
.
g
etRawClient
()
if
rawClient
==
nil
{
return
ErrNilETCDV3Client
...
...
@@ -219,7 +219,7 @@ func (c *Client) put(k string, v string, opts ...clientv3.OpOption) error {
// if k not exist will put k/v in etcd
// if k is already exist in etcd, replace it
func
(
c
*
Client
)
update
(
k
string
,
v
string
,
opts
...
clientv3
.
OpOption
)
error
{
rawClient
:=
c
.
G
etRawClient
()
rawClient
:=
c
.
g
etRawClient
()
if
rawClient
==
nil
{
return
ErrNilETCDV3Client
...
...
@@ -233,7 +233,7 @@ func (c *Client) update(k string, v string, opts ...clientv3.OpOption) error {
}
func
(
c
*
Client
)
delete
(
k
string
)
error
{
rawClient
:=
c
.
G
etRawClient
()
rawClient
:=
c
.
g
etRawClient
()
if
rawClient
==
nil
{
return
ErrNilETCDV3Client
...
...
@@ -244,7 +244,7 @@ func (c *Client) delete(k string) error {
}
func
(
c
*
Client
)
get
(
k
string
)
(
string
,
error
)
{
rawClient
:=
c
.
G
etRawClient
()
rawClient
:=
c
.
g
etRawClient
()
if
rawClient
==
nil
{
return
""
,
ErrNilETCDV3Client
...
...
@@ -264,7 +264,7 @@ func (c *Client) get(k string) (string, error) {
// CleanKV delete all key and value
func
(
c
*
Client
)
CleanKV
()
error
{
rawClient
:=
c
.
G
etRawClient
()
rawClient
:=
c
.
g
etRawClient
()
if
rawClient
==
nil
{
return
ErrNilETCDV3Client
...
...
@@ -275,7 +275,7 @@ func (c *Client) CleanKV() error {
}
func
(
c
*
Client
)
getChildren
(
k
string
)
([]
string
,
[]
string
,
error
)
{
rawClient
:=
c
.
G
etRawClient
()
rawClient
:=
c
.
g
etRawClient
()
if
rawClient
==
nil
{
return
nil
,
nil
,
ErrNilETCDV3Client
...
...
@@ -300,7 +300,7 @@ func (c *Client) getChildren(k string) ([]string, []string, error) {
}
func
(
c
*
Client
)
watchWithPrefix
(
prefix
string
)
(
clientv3
.
WatchChan
,
error
)
{
rawClient
:=
c
.
G
etRawClient
()
rawClient
:=
c
.
g
etRawClient
()
if
rawClient
==
nil
{
return
nil
,
ErrNilETCDV3Client
...
...
@@ -310,7 +310,7 @@ func (c *Client) watchWithPrefix(prefix string) (clientv3.WatchChan, error) {
}
func
(
c
*
Client
)
watch
(
k
string
)
(
clientv3
.
WatchChan
,
error
)
{
rawClient
:=
c
.
G
etRawClient
()
rawClient
:=
c
.
g
etRawClient
()
if
rawClient
==
nil
{
return
nil
,
ErrNilETCDV3Client
...
...
@@ -320,7 +320,7 @@ func (c *Client) watch(k string) (clientv3.WatchChan, error) {
}
func
(
c
*
Client
)
keepAliveKV
(
k
string
,
v
string
)
error
{
rawClient
:=
c
.
G
etRawClient
()
rawClient
:=
c
.
g
etRawClient
()
if
rawClient
==
nil
{
return
ErrNilETCDV3Client
...
...
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