Skip to content

Instantly share code, notes, and snippets.

@SrDios
Created October 23, 2018 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SrDios/78baefb7e638fa75d2fbb41df89bd71b to your computer and use it in GitHub Desktop.
Save SrDios/78baefb7e638fa75d2fbb41df89bd71b to your computer and use it in GitHub Desktop.
func addKongConsumer(consumer string) {
resp, err := http.PostForm(KongURL+"consumers/", url.Values{"username": {consumer}, "custom_id": {consumer}})
if err != nil {
color.R.Printf(err.Error())
} else {
_, err := ioutil.ReadAll(resp.Body)
if err != nil {
color.R.Printf(err.Error())
}
color.G.Printf("Add Consumer with name %s\n", consumer)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment