*: expose etcd-index in watch requests

This adds a StartIndex field to the Watcher interface, which represents
the Etcd-Index at which the Watcher is created.

Also refactors the HTTP tests to use a table for most handleWatch tests
This commit is contained in:
Jonathan Boulle
2014-09-26 11:34:11 -07:00
parent 8490904f20
commit 1c11f6a144
6 changed files with 140 additions and 121 deletions

View File

@ -1059,6 +1059,7 @@ func (s *storeRecorder) DeleteExpiredKeys(cutoff time.Time) {
type stubWatcher struct{}
func (w *stubWatcher) EventChan() chan *store.Event { return nil }
func (w *stubWatcher) StartIndex() uint64 { return 0 }
func (w *stubWatcher) Remove() {}
// errStoreRecorder returns an store error on Get, Watch request