Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventType ¶
type EventType string
EventType definition for watch
const ( //EventSync sync event, reserved for force synchronization EventSync EventType = "SYNC" //EventAdded add event EventAdded EventType = "ADDED" //EventUpdated updated/modified event EventUpdated EventType = "UPDATED" //EventDeleted deleted event EventDeleted EventType = "DELETED" //EventErr error event for watch, error occured, but watch still works EventErr EventType = "ERROR" //DefaultChannelBuffer buffer for watch event channel DefaultChannelBuffer = 128 )
type Interface ¶
type Interface interface { //stop watch channel Stop() //get watch events, if watch stopped/error, watch must close // channel and exit, watch user must read channel like // e, ok := <-channel WatchEvent() <-chan Event }
Interface define watch channel
func NewSelectWatch ¶
func NewSelectWatch(w Interface, fn SelectFunc) Interface
NewSelectWatch wrap watcher with filter func
type SelectFunc ¶
SelectFunc custom function to verify how filter acts
type SelectorWatch ¶
type SelectorWatch struct {
// contains filtered or unexported fields
}
SelectorWatch watcher wraper offer filter function to filter data object if needed
func (*SelectorWatch) WatchEvent ¶
func (fw *SelectorWatch) WatchEvent() <-chan Event
WatchEvent get watch events
Click to show internal directories.
Click to hide internal directories.