File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ conn = Etcdv3.new(endpoints: 'https://hostname:port')
26
26
# Secure connection with Auth
27
27
conn = Etcdv3 .new (endpoints: ' https://hostname:port' , user: ' root' , password: ' mysecretpassword' )
28
28
29
+ # Scope CRUD operations to a specific keyspace.
30
+ conn = Etcdv3 .new (endpoints: ' https://hostname:port' , namespace: " /target_keyspace/" )
31
+
29
32
# Secure connection specifying custom certificates
30
33
# Coming soon...
31
34
@@ -48,6 +51,24 @@ need to take care of `GRPC::Unauthenticated` exception and manually re-authentic
48
51
when token expires. To reiterate, you are responsible for handling the errors, so
49
52
some understanding of how this gem and etcd works is recommended.
50
53
54
+ ## Namespace support
55
+
56
+ Namespacing is a convenience feature used to scope CRUD based operations to a specific keyspace.
57
+
58
+ ``` ruby
59
+ # Establish connection
60
+ conn = Etcdv3 .new (endpoints: ' https://hostname:port' , namespace: ' /service-a/' )
61
+
62
+ # Write key to /service-a/test_key
63
+ conn.put(" test_key" , " value" ).
64
+
65
+ # Get the key we just wrote.
66
+ conn.get(" test_key" )
67
+ ```
68
+
69
+ _ Note: Namespaces are stripped from responses._
70
+
71
+
51
72
## Adding, Fetching and Deleting Keys
52
73
``` ruby
53
74
# Put
You can’t perform that action at this time.
0 commit comments