Registry / database / etcd-client-v3

etcd-client-v3

JSON →
library3.6.12gogounverified

Package clientv3 implements the official Go etcd client for v3.

go get go.etcd.io/etcd/client/v3
INSTALL
IMPORT
SIG · ETCD-CLIENT-V3
E
etcd-client-v3
databasegov3.6.12
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

clientv3
go.etcd.io/etcd/client/v3

Connects to etcd and sets a key-value pair.

package main import ( "context" "fmt" clientv3 "go.etcd.io/etcd/client/v3" "time" ) func main() { cli, err := clientv3.New(clientv3.Config{ Endpoints: []string{"localhost:2379"}, DialTimeout: 5 * time.Second, }) if err != nil { panic(err) } defer cli.Close() ctx, cancel := context.WithTimeout(context.Background(), time.Second) _, err = cli.Put(ctx, "key", "value") cancel() if err != nil { panic(err) } fmt.Println("Key set successfully") }
Debug
Known issues
breakingBreaking changes between etcd v3.4 and v3.5+ in client API
fix
Use the go.etcd.io/etcd/client/v3 module for v3.5+; older versions use go.etcd.io/etcd/clientv3
affects: <3.5.0
Upgrade
Version history
3.6.12latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
16
OpenAI (training)
1
Resources
etcd-client-v3 — go get etcd-client-v3 · libregistry