![]() * provider/consul: first stab at adding prepared query support * provider/consul: flatten pq resource * provider/consul: implement updates for PQ's * provider/consul: implement PQ delete * provider/consul: add acceptance tests for prepared queries * provider/consul: add template support to PQ's * provider/consul: use substructures to express optional related components for PQs * website: first pass at consul prepared query docs * provider/consul: PQ's support datacenter option and store_token option * provider/consul: remove store_token on PQ's for now * provider/consul: allow specifying a separate stored_token * website: update consul PQ docs * website: add link to consul_prepared_query resource * vendor: update github.com/hashicorp/consul/api * provider/consul: handle 404's when reading prepared queries * provider/consul: prepared query failover dcs is a list * website: update consul PQ example usage * website: re-order arguments for consul prepared queries |
||
---|---|---|
.. | ||
README.md | ||
acl.go | ||
agent.go | ||
api.go | ||
catalog.go | ||
coordinate.go | ||
event.go | ||
health.go | ||
kv.go | ||
lock.go | ||
prepared_query.go | ||
raw.go | ||
semaphore.go | ||
session.go | ||
status.go |
README.md
Consul API client
This package provides the api
package which attempts to
provide programmatic access to the full Consul API.
Currently, all of the Consul APIs included in version 0.6.0 are supported.
Documentation
The full documentation is available on Godoc
Usage
Below is an example of using the Consul client:
// Get a new client
client, err := api.NewClient(api.DefaultConfig())
if err != nil {
panic(err)
}
// Get a handle to the KV API
kv := client.KV()
// PUT a new KV pair
p := &api.KVPair{Key: "foo", Value: []byte("test")}
_, err = kv.Put(p, nil)
if err != nil {
panic(err)
}
// Lookup the pair
pair, _, err := kv.Get("foo", nil)
if err != nil {
panic(err)
}
fmt.Printf("KV: %v", pair)