![Gitter](https://badges.gitter.im/Join Chat.svg)
A Clojure library to interact with an etcd server.
Why etcd and not Zookeeper? Well Zookeeper is a bloated terrifying piece of software while etcd is tiny, fast, efficient.
Why this project at all? Googling for etcd & clojure returned zero results. Now there are a bunch of alternatives, pick up your favourite from etcd clients matrix.
This library now supports V2 of the etcd API.
The default server endpoint is http://127.0.0.1 running on port 4001, however you can 'connect' to any server by using the connect! function:
(connect! "196.0.0.1")
(connect! "196.0.0.1" 4001)
(connect! "196.0.0.1" 4001 7001)
(version)
(set "key" "value")
(set "key" "value" :ttl 5)
(get "key")
(defn callback[arg] (println (str "Key change: " arg)))
(get "key" :wait true :callback callback)
(set "key" "someothervalue")
(delete "key")
Where callback can be for example:
(defn callback[arg] (println arg))
(create-in-order "key"
This reflects the example on the etcd api page
(set "foo" "one")
(set "foo" "three" :prev-exist false)
(set "foo" "two" :prev-value "one")
This reflects the example on the etcd api page
(set "foo" "one")
(delete "foo" :prev-value "two")
(delete "foo" :prev-index 1)
(list "/directory")
(list-in-order "/directory")
(create-dir "/directory")
(delete-dir "/directory")
(delete "key")
(stats)
(self-stats)
(store-stats)
(members)
- connect to cluster
- failover and recovery
- SSL (looks tricky - might need to change clj-http)
Apache 2.0