Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
davissp14 authored Aug 1, 2021
1 parent 0af4a1e commit acb7fda
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ conn = Etcdv3.new(endpoints: 'https://hostname:port')
# Secure connection with Auth
conn = Etcdv3.new(endpoints: 'https://hostname:port', user: 'root', password: 'mysecretpassword')

# Scope CRUD operations to a specific keyspace.
conn = Etcdv3.new(endpoints: 'https://hostname:port', namespace: "/target_keyspace/")

# Secure connection specifying custom certificates
# Coming soon...

Expand All @@ -48,6 +51,24 @@ need to take care of `GRPC::Unauthenticated` exception and manually re-authentic
when token expires. To reiterate, you are responsible for handling the errors, so
some understanding of how this gem and etcd works is recommended.

## Namespace support

Namespacing is a convenience feature used to scope CRUD based operations to a specific keyspace.

```ruby
# Establish connection
conn = Etcdv3.new(endpoints: 'https://hostname:port', namespace: '/service-a/')

# Write key to /service-a/test_key
conn.put("test_key", "value").

# Get the key we just wrote.
conn.get("test_key")
```

_Note: Namespaces are stripped from responses._


## Adding, Fetching and Deleting Keys
```ruby
# Put
Expand Down

0 comments on commit acb7fda

Please sign in to comment.