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

..03-May-2022-

.gitignoreH A D02-Feb-2018259

LICENSEH A D02-Feb-201815.5 KiB

README.mdH A D02-Feb-2018975

acl.goH A D02-Feb-20183.3 KiB

acl_test.goH A D02-Feb-20182.2 KiB

agent.goH A D02-Feb-20186.4 KiB

agent_test.goH A D02-Feb-20182.9 KiB

api.goH A D02-Feb-20187.6 KiB

api_test.goH A D02-Feb-20182.5 KiB

catalog.goH A D02-Feb-20183.9 KiB

catalog_test.goH A D02-Feb-20183.8 KiB

event.goH A D02-Feb-20182.6 KiB

event_test.goH A D02-Feb-2018591

health.goH A D02-Feb-20183.2 KiB

health_test.goH A D02-Feb-20181.7 KiB

kv.goH A D02-Feb-20185.5 KiB

kv_test.goH A D02-Feb-20187.5 KiB

session.goH A D02-Feb-20184.6 KiB

session_test.goH A D02-Feb-20183.1 KiB

status.goH A D02-Feb-2018938

status_test.goH A D02-Feb-2018471

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