go.etcd.io/etcd/client/v3v3.5.0-beta.4
Package clientv3 implements the official Go etcd client for v3.
Create client using `clientv3.New`:
Make sure to close the client after using it. If the client is not closed, the
connection will have leaky goroutines.
To specify a client request timeout, wrap the context with context.WithTimeout:
The Client has internal state (watchers and leases), so Clients should be reused instead of created as needed.
Clients are safe for concurrent use by multiple goroutines.
etcd client returns 2 types of errors:
Here is the example code to handle client errors:
The grpc load balancer is registered statically and is shared across etcd clients.
To enable detailed load balancer logging, set the ETCD_CLIENT_DEBUG environment
variable. E.g. "ETCD_CLIENT_DEBUG=1".