mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-17 12:12:59 -06:00
6fe2703665
* Remove `make updatedeps` from Travis build. We'll follow up with more specific plans around dependency updating in subsequent PRs. * Update all `make` targets to set `GO15VENDOREXPERIMENT=1` and to filter out `/vendor/` from `./...` where appropriate. * Temporarily remove `vet` from the `make test` target until we can figure out how to get it to not vet `vendor/`. (Initial experimentation failed to yield the proper incantation.) Everything is pinned to current master, with the exception of: * Azure/azure-sdk-for-go which is pinned before the breaking change today * aws/aws-sdk-go which is pinned to the most recent tag The documentation still needs to be updated, which we can do in a follow up PR. The goal here is to unblock release. |
||
---|---|---|
.. | ||
acl_test.go | ||
acl.go | ||
agent_test.go | ||
agent.go | ||
api_test.go | ||
api.go | ||
catalog_test.go | ||
catalog.go | ||
coordinate_test.go | ||
coordinate.go | ||
event_test.go | ||
event.go | ||
health_test.go | ||
health.go | ||
kv_test.go | ||
kv.go | ||
lock_test.go | ||
lock.go | ||
prepared_query_test.go | ||
prepared_query.go | ||
raw.go | ||
README.md | ||
semaphore_test.go | ||
semaphore.go | ||
session_test.go | ||
session.go | ||
status_test.go | ||
status.go |
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)