Registry / networking / hashicorp-consul-api

hashicorp-consul-api

JSON →
library1.34.3gogounverified

Provides a Go client for the HashiCorp Consul HTTP API.

go get github.com/hashicorp/consul/api
INSTALL
IMPORT
SIG · HASHICORP-CONSUL-A
H
hashicorp-consul-api
networkinggov1.34.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

api
github.com/hashicorp/consul/api

Create a Consul client and retrieve agent self information.

package main import ( "fmt" "github.com/hashicorp/consul/api" ) func main() { client, err := api.NewClient(api.DefaultConfig()) if err != nil { panic(err) } agent := client.Agent() self, err := agent.Self() if err != nil { panic(err) } fmt.Println(self["Config"]["NodeName"]) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.34.3latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
hashicorp-consul-api — go get hashicorp-consul-api · libregistry