Skip to content

Commit

Permalink
add function to get etcd client (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
WangXiangUSTC authored Nov 27, 2019
1 parent 617bc41 commit 82cd8d6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/etcd/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ func (e *Client) Close() error {
return nil
}

// GetClient returns client
func (e *Client) GetClient() *clientv3.Client {
return e.client
}

// Create guarantees to set a key = value with some options(like ttl)
func (e *Client) Create(ctx context.Context, key string, val string, opts []clientv3.OpOption) (int64, error) {
key = keyWithPrefix(e.rootPath, key)
Expand Down

0 comments on commit 82cd8d6

Please sign in to comment.