gapi: Move separate etcd Watch method into GAPI

This cleans up the API to not have a special case for etcd anymore. In
particular, this also adds the requirement that the GAPI must generate
an event on startup as soon as it is ready to generate a graph.
This commit is contained in:
James Shubin
2017-03-20 15:10:27 -04:00
parent 66d9c7091c
commit 6fd5623b1f
6 changed files with 62 additions and 40 deletions

View File

@@ -27,6 +27,12 @@ type World struct {
EmbdEtcd *EmbdEtcd
}
// ResWatch returns a channel which spits out events on possible exported
// resource changes.
func (obj *World) ResWatch() chan error {
return WatchResources(obj.EmbdEtcd)
}
// ResExport exports a list of resources under our hostname namespace.
// Subsequent calls replace the previously set collection atomically.
func (obj *World) ResExport(resourceList []resources.Res) error {