Created
December 5, 2015 00:07
-
-
Save asim/6d206d84f5b58ee65d66 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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