Skip to content

csm/clojure-consul-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clojure-consul-client

Clojars Project cljdoc

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])

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

About

Yet another consul client for clojure

Resources

License

Stars

Watchers

Forks

Packages

No packages published