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