Skip to content

Instantly share code, notes, and snippets.

@philips
Created November 7, 2015 13:53
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 philips/682feed223d13d83b718 to your computer and use it in GitHub Desktop.
Save philips/682feed223d13d83b718 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"net/http"
)
func main() {
waitIndex := 0
for {
resp, err := http.Get(fmt.Sprintf("http://localhost:2379/v2/keys/foobar/baz?wait=true&waitTimeout=90000000&waitIndex=%d", waitIndex))
if err != nil {
panic(err)
}
fmt.Println(resp.Header["X-Etcd-Index"])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment