Liking cljdoc? Tell your friends :D


Clojars Project

A synchronous and asynchronous Consul client built on vainglory and consul-api.

(require '[consul.client :as consul])

(def client (consul/consul {}))

; Get a map describing supported operations
(consul/ops client)
(:listDatacenters (consul/ops client))

; Invoke an operation.
(consul/invoke {:op :listDatacenters})
(consul/invoke {:op :writeKey :request {:key "test" :body "something for this key"}})
(consul/invoke {:op :readKey :request {:key "test"}})

; Or go async
(require '[consul.client.async :as ca])
(require '[manifold.deferred :as d])

  (ca/invoke client {:op :readKey :request {:key "test" :index 1234 :wait "15s"}})
  (fn [response] ...))

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close