Documentation ¶
Overview ¶
Package watch implements better watch semantics on top of etcd. See this issue for the reasoning behind the package: https://github.com/coreos/etcd/issues/7362
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Event ¶
type Event struct { Key []byte Value []byte PrevKey []byte PrevValue []byte Type EventType Rev int64 Err error Template proto.Message }
Event is an event that occurred to an item in etcd.
type OpOption ¶ added in v1.8.6
OpOption is a simple typedef for etcd.OpOption.
func WithFilterPut ¶ added in v1.8.6
func WithFilterPut() OpOption
WithFilterPut discards PUT events from the watcher.
func WithPrevKV ¶ added in v1.8.6
func WithPrevKV() OpOption
WithPrevKV gets the previous key-value pair before the event happens. If the previous KV is already compacted, nothing will be returned.
type Watcher ¶
type Watcher interface { // Watch returns a channel that delivers events Watch() <-chan *Event // Close this channel when you are done receiving events Close() }
Watcher ...
func MakeWatcher ¶
MakeWatcher returns a Watcher that uses the given event channel and done channel internally to deliver events and signal closure, respectively.
Click to show internal directories.
Click to hide internal directories.