Categorygithub.com/armon/consul-api
modulepackage
0.0.0-20180202201655-eb2c6b5be1b6
Repository: https://github.com/armon/consul-api.git
Documentation: pkg.go.dev

# README

consul-api

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

This package provides the consulapi package which attempts to provide programmatic access to the full Consul API.

Currently, all of the Consul APIs included in version 0.4 are supported.

Documentation

The full documentation is available on Godoc

Usage

Below is an example of using the Consul client:

// Get a new client, with KV endpoints
client, _ := consulapi.NewClient(consulapi.DefaultConfig())
kv := client.KV()

// PUT a new KV pair
p := &consulapi.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)

# Functions

DefaultConfig returns a default configuration for the client.
NewClient returns a new client.

# Constants

ACLCLientType is the client type token.
ACLManagementType is the management type token.

# Structs

ACL can be used to query the ACL endpoints.
ACLEntry is used to represent an ACL entry.
Agent can be used to query the Agent endpoints.
AgentCheck represents a check known to the agent.
AgentCheckRegistration is used to register a new check.
AgentMember represents a cluster member known to the agent.
AgentService represents a service known to the agent.
AgentServiceCheck is used to create an associated check for a service.
AgentServiceRegistration is used to register a new service.
Catalog can be used to query the Catalog endpoints.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Client provides a client to the Consul API.
Config is used to configure the creation of a client.
Event can be used to query the Event endpoints.
Health can be used to query the Health endpoints.
HealthCheck is used to represent a single check.
HttpBasicAuth is used to authenticate http client with HTTP Basic Authentication.
KV is used to manipulate the K/V API.
KVPair is used to represent a single K/V entry.
No description provided by the author
QueryMeta is used to return meta data about a query.
QueryOptions are used to parameterize a query.
ServiceEntry is used for the health service endpoint.
Session can be used to query the Session endpoints.
SessionEntry represents a session in consul.
Status can be used to query the Status endpoints.
UserEvent represents an event that was fired by the user.
WriteMeta is used to return meta data about a write.
WriteOptions are used to parameterize a write.

# Type aliases

KVPairs is a list of KVPair objects.