func nodeEventHandler(eventType string, state string, action string) error { if (eventType == "node" && state == "Deployed" && action == "update") || (eventType == "node" && state == "Terminated") { err := nodes.DiscoverPeers() if err != nil { return err } } return nil }
func discovering(wg *sync.WaitGroup) { defer wg.Done() c := make(chan dockercloud.Event) e := make(chan error) nodes.DiscoverPeers() go dockercloud.Events(c, e) tutumEventHandler(wg, c, e) }