File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ Endpoints are added to the service by creating new keys and removed from the ser
44
44
New endpoints can be added to the service through ` etcdctl ` :
45
45
46
46
``` sh
47
- ETCDCTL_API=3 etcdctl put foo/bar/my-service/1.2.3.4 ' {"Addr":"1.2.3.4","Metadata":"..." }'
47
+ ETCDCTL_API=3 etcdctl put foo/bar/my-service/1.2.3.4 ' {"Addr":"1.2.3.4"}'
48
48
```
49
49
50
50
The etcd client's ` endpoints.Manager ` method can also register new endpoints with a key matching the ` Addr ` :
@@ -59,8 +59,8 @@ To enable round-robin load balancing when dialing service with multiple endpoint
59
59
60
60
``` go
61
61
62
- conn , gerr := grpc.Dial (" etcd:///foo" , grpc.WithResolvers (etcdResolver),
63
- grpc.WithDefaultServiceConfig (` {"loadBalancingPolicy":"round_robin"}` ))
62
+ conn , gerr := grpc.NewClient (" etcd:///foo" , grpc.WithResolvers (etcdResolver),
63
+ grpc.WithDefaultServiceConfig (` {"loadBalancingPolicy":"round_robin"}` ))
64
64
```
65
65
66
66
### Deleting an endpoint
@@ -84,7 +84,7 @@ Registering an endpoint with a lease ensures that if the host can't maintain a k
84
84
85
85
``` sh
86
86
lease=` ETCDCTL_API=3 etcdctl lease grant 5 | cut -f2 -d' ' `
87
- ETCDCTL_API=3 etcdctl put --lease=$lease my-service/1.2.3.4 ' {"Addr":"1.2.3.4","Metadata":"..." }'
87
+ ETCDCTL_API=3 etcdctl put --lease=$lease my-service/1.2.3.4 ' {"Addr":"1.2.3.4"}'
88
88
ETCDCTL_API=3 etcdctl lease keep-alive $lease
89
89
```
90
90
In the golang:
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ Endpoints are added to the service by creating new keys and removed from the ser
44
44
New endpoints can be added to the service through ` etcdctl ` :
45
45
46
46
``` sh
47
- ETCDCTL_API=3 etcdctl put foo/bar/my-service/1.2.3.4 ' {"Addr":"1.2.3.4","Metadata":"..." }'
47
+ ETCDCTL_API=3 etcdctl put foo/bar/my-service/1.2.3.4 ' {"Addr":"1.2.3.4"}'
48
48
```
49
49
50
50
The etcd client's ` endpoints.Manager ` method can also register new endpoints with a key matching the ` Addr ` :
@@ -59,8 +59,8 @@ To enable round-robin load balancing when dialing service with multiple endpoint
59
59
60
60
``` go
61
61
62
- conn , gerr := grpc.Dial (" etcd:///foo" , grpc.WithResolvers (etcdResolver),
63
- grpc.WithDefaultServiceConfig (` {"loadBalancingPolicy":"round_robin"}` ))
62
+ conn , gerr := grpc.NewClient (" etcd:///foo" , grpc.WithResolvers (etcdResolver),
63
+ grpc.WithDefaultServiceConfig (` {"loadBalancingPolicy":"round_robin"}` ))
64
64
```
65
65
66
66
### Deleting an endpoint
@@ -84,7 +84,7 @@ Registering an endpoint with a lease ensures that if the host can't maintain a k
84
84
85
85
``` sh
86
86
lease=` ETCDCTL_API=3 etcdctl lease grant 5 | cut -f2 -d' ' `
87
- ETCDCTL_API=3 etcdctl put --lease=$lease my-service/1.2.3.4 ' {"Addr":"1.2.3.4","Metadata":"..." }'
87
+ ETCDCTL_API=3 etcdctl put --lease=$lease my-service/1.2.3.4 ' {"Addr":"1.2.3.4"}'
88
88
ETCDCTL_API=3 etcdctl lease keep-alive $lease
89
89
```
90
90
In the golang:
You can’t perform that action at this time.
0 commit comments