etcd: Add world API changes for watching member status

This adds some useful functionality so that anyone with access to the
world API, can learn information about the changing etcd cluster it's
using.
This commit is contained in:
James Shubin
2018-04-12 03:27:05 -04:00
parent 0c751ea14f
commit 738485a655
7 changed files with 192 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ package engine
import (
"context"
"github.com/purpleidea/mgmt/etcd/interfaces"
"github.com/purpleidea/mgmt/etcd/scheduler"
)
@@ -51,4 +52,7 @@ type World interface { // TODO: is there a better name for this interface?
Scheduler(namespace string, opts ...scheduler.Option) (*scheduler.Result, error)
Fs(uri string) (Fs, error)
// WatchMembers returns a channel of changing members in the cluster.
WatchMembers(context.Context) (<-chan *interfaces.MembersResult, error)
}