forked from etcd-io/etcd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
11 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,26 +11,23 @@ | |
go get go.etcd.io/etcd/client/v3 | ||
``` | ||
|
||
Warning: As etcd 3.5.0 was not yet released, the command above does not work. | ||
After first pre-release of 3.5.0 [#12498](https://github.com/etcd-io/etcd/issues/12498), | ||
etcd can be referenced using: | ||
``` | ||
go get go.etcd.io/etcd/client/[email protected] | ||
``` | ||
|
||
## Get started | ||
|
||
Create client using `clientv3.New`: | ||
|
||
```go | ||
cli, err := clientv3.New(clientv3.Config{ | ||
Endpoints: []string{"localhost:2379", "localhost:22379", "localhost:32379"}, | ||
DialTimeout: 5 * time.Second, | ||
}) | ||
if err != nil { | ||
// handle error! | ||
import clientv3 "go.etcd.io/etcd/client/v3" | ||
|
||
func main() { | ||
cli, err := clientv3.New(clientv3.Config{ | ||
Endpoints: []string{"localhost:2379", "localhost:22379", "localhost:32379"}, | ||
DialTimeout: 5 * time.Second, | ||
}) | ||
if err != nil { | ||
// handle error! | ||
} | ||
defer cli.Close() | ||
} | ||
defer cli.Close() | ||
``` | ||
|
||
etcd v3 uses [`gRPC`](https://www.grpc.io) for remote procedure calls. And `clientv3` uses | ||
|