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

..03-May-2022-

.gitignoreH A D02-Feb-2018259 2418

LICENSEH A D02-Feb-201815.5 KiB362265

README.mdH A D02-Feb-2018975 4330

acl.goH A D02-Feb-20183.3 KiB141110

acl_test.goH A D02-Feb-20182.2 KiB141113

agent.goH A D02-Feb-20186.4 KiB273211

agent_test.goH A D02-Feb-20182.9 KiB163134

api.goH A D02-Feb-20187.6 KiB324207

api_test.goH A D02-Feb-20182.5 KiB127113

catalog.goH A D02-Feb-20183.9 KiB182147

catalog_test.goH A D02-Feb-20183.8 KiB220169

event.goH A D02-Feb-20182.6 KiB10581

event_test.goH A D02-Feb-2018591 3829

health.goH A D02-Feb-20183.2 KiB137108

health_test.goH A D02-Feb-20181.7 KiB9979

kv.goH A D02-Feb-20185.5 KiB220173

kv_test.goH A D02-Feb-20187.5 KiB375303

session.goH A D02-Feb-20184.6 KiB205167

session_test.goH A D02-Feb-20183.1 KiB191156

status.goH A D02-Feb-2018938 4433

status_test.goH A D02-Feb-2018471 3226

README.md

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