micro/registry/watcher.go

17 lines
348 B
Go
Raw Normal View History

2015-12-05 04:12:29 +03:00
package registry
2015-12-05 05:05:06 +03:00
// Watcher is an interface that returns updates
// about services within the registry.
2015-12-05 04:12:29 +03:00
type Watcher interface {
2015-12-05 05:05:06 +03:00
// Next is a blocking call
2015-12-05 04:12:29 +03:00
Next() (*Result, error)
Stop()
}
2015-12-05 05:05:06 +03:00
// Result is returned by a call to Next on
// the watcher. Actions can be create, update, delete
2015-12-05 04:12:29 +03:00
type Result struct {
Action string
Service *Service
}