mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00

if we want to add an endpoint with lease, we need this option. for example: resp, err := cli.Grant(context.TODO(), 5) if err != nil { log.Fatal(err) } err = r.Update(context.TODO(), serviceName, naming.Update{Op:naming.Add, Addr: exposedAddr}, clientv3.WithLease(resp.ID)) if err != nil { log.Fatalf(err) }