• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..25-Dec-2020-

README.mdH A D25-Dec-2020775 4028

acl.goH A D25-Dec-20203.3 KiB141110

agent.goH A D25-Dec-20208.2 KiB335261

api.goH A D25-Dec-202010.2 KiB443307

catalog.goH A D25-Dec-20204 KiB183148

event.goH A D25-Dec-20202.6 KiB10581

health.goH A D25-Dec-20203.2 KiB137108

kv.goH A D25-Dec-20206.1 KiB237186

lock.goH A D25-Dec-20208.2 KiB327212

raw.goH A D25-Dec-2020749 2513

semaphore.goH A D25-Dec-202012.5 KiB478319

session.goH A D25-Dec-20204.8 KiB202160

status.goH A D25-Dec-2020932 4433

README.md

1Consul API client
2=================
3
4This package provides the `api` package which attempts to
5provide programmatic access to the full Consul API.
6
7Currently, all of the Consul APIs included in version 0.3 are supported.
8
9Documentation
10=============
11
12The full documentation is available on [Godoc](http://godoc.org/github.com/hashicorp/consul/api)
13
14Usage
15=====
16
17Below is an example of using the Consul client:
18
19```go
20// Get a new client, with KV endpoints
21client, _ := api.NewClient(api.DefaultConfig())
22kv := client.KV()
23
24// PUT a new KV pair
25p := &api.KVPair{Key: "foo", Value: []byte("test")}
26_, err := kv.Put(p, nil)
27if err != nil {
28    panic(err)
29}
30
31// Lookup the pair
32pair, _, err := kv.Get("foo", nil)
33if err != nil {
34    panic(err)
35}
36fmt.Printf("KV: %v", pair)
37
38```
39
40