coreos/etcdctl — pull request #5 by emilisto (2013-08-09 14:42:50+00:00)
Title: Added commands for working with "sets"

The _set_ is a primitive I think could be useful for etcd - either
implemented in the core or on the client-side. Basically they can be
used to store a set of values of the same type under a single key.

An example:

```bash
$ ./etcdctl setadd /queues amqp://user:password@rabbitmq1
amqp://user:password@rabbitmq1
$ ./etcdctl setadd /queues amqp://user:password@rabbitmq2
amqp://user:password@rabbitmq2
$ ./etcdctl setmembers /queues
"amqp://user:password@rabbitmq1"
"amqp://user:password@rabbitmq1"
# So the server has to re-register itself every minute
$ ./etcdctl setadd /queues amqp://user:password@rabbitmq2 --ttl=60
$ ./etcdctl setremove /queues amqp://user:password@rabbitmq2
```

I created an [issue in etcd](https://github.com/coreos/etcd/issues/48) for this, but we agreed that it'd be better to try it out here, to avoid introducing unnecessary complexity in the core.

The commands I've added are:

- `setadd `
- `setremove `
- `setmembers `
- `setismember `

This is all implemented using the existing `set`, `get` and `delete` commands.

Let me know what you think!