Skip to content

Instantly share code, notes, and snippets.

@asim
Created December 5, 2015 00:07
Show Gist options
  • Save asim/6d206d84f5b58ee65d66 to your computer and use it in GitHub Desktop.
Save asim/6d206d84f5b58ee65d66 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
_ "github.com/micro/go-plugins/registry/etcd"
"github.com/micro/go-micro/registry"
"github.com/micro/go-micro/cmd"
)
func main() {
cmd.Init()
w, err := registry.Watch()
if err != nil {
fmt.Println(err)
return
}
for {
r, err := w.Next()
if err != nil {
fmt.Println("err getting next:", err)
break
}
fmt.Printf("got next %+v %+v\n", r, r.Service)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment