Skip to content

armon/consul-kv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

consul-kv

DEPRECATED Please use consul api package instead. Godocs for that package are here.

This package provides the consulkv package which is a Key/Value client for Consul. It supports all the commands as of Consul 0.1, and has a very simple API.

Documentation

The full documentation is available on Godoc

Usage

Below is an example of using the Consul KV client:

client, _ := consulkv.NewClient(consulkv.DefaultConfig())

key := "foo"
value := []byte("test")
client.Put(key, value, 42)

meta, pair, err := client.Get(key)
fmt.Printf("Got %s (%d): %s", pair.Key, pair.Flags, pair.Value)

Development

To run the tests, first run a consul server with API port 8500:

consul agent -data-dir /tmp/consul -server -bootstrap

The run tests:

go test

About

Golang K/V client for Consul

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages