* normalize status conditions for gateways and routes
* Added tests for checking condition status and panic conditions for
validating combinations, added dummy code for fsm store
* get rid of unneeded gateway condition generator struct
* Remove unused file
* run go mod tidy
* Update tests, add conflicted gateway status
* put back removed status for test
* Fix linting violation, remove custom conflicted status
* Update fsm commands oss
* Fix incorrect combination of type/condition/status
* cleaning up from PR review
* Change "invalidCertificate" to be of accepted status
* Move status condition enums into api package
* Update gateways controller and generated code
* Update conditions in fsm oss tests
* run go mod tidy on consul-container module to fix linting
* Fix type for gateway endpoint test
* go mod tidy from changes to api
* go mod tidy on troubleshoot
* Fix route conflicted reason
* fix route conflict reason rename
* Fix text for gateway conflicted status
* Add valid certificate ref condition setting
* Revert change to resolved refs to be handled in future PR
Below is an example of using the Consul client. To run the example, you must first
install Consul and
Go.
To run the client API, create a new Go module.
go mod init consul-demo
Copy the example code into a file called main.go in the directory where the module is defined.
As seen in the example, the Consul API is often imported with the alias capi.
packagemainimport("fmt"capi"github.com/hashicorp/consul/api")funcmain(){// Get a new client
client,err:=capi.NewClient(capi.DefaultConfig())iferr!=nil{panic(err)}// Get a handle to the KV API
kv:=client.KV()// PUT a new KV pair
p:=&capi.KVPair{Key:"REDIS_MAXCLIENTS",Value:[]byte("1000")}_,err=kv.Put(p,nil)iferr!=nil{panic(err)}// Lookup the pair
pair,_,err:=kv.Get("REDIS_MAXCLIENTS",nil)iferr!=nil{panic(err)}fmt.Printf("KV: %v %s\n",pair.Key,pair.Value)}
Install the Consul API dependency with go mod tidy.
In a separate terminal window, start a local Consul server.
consul agent -dev -node machine
Run the example.
go run .
You should get the following result printed to the terminal.
KV: REDIS_MAXCLIENTS 1000
After running the code, you can also view the values in the Consul UI on your local machine at http://localhost:8500/ui/dc1/kv