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

@@ -60,4 +60,7 @@ type Client interface {
Txn(ctx context.Context, ifCmps []etcd.Cmp, thenOps, elseOps []etcd.Op) (*etcd.TxnResponse, error)
Watcher(ctx context.Context, path string, opts ...etcd.OpOption) (chan error, error)
ComplexWatcher(ctx context.Context, path string, opts ...etcd.OpOption) (*WatcherInfo, error)
// WatchMembers returns a channel of changing members in the cluster.
WatchMembers(context.Context) (<-chan *MembersResult, error)
}