Documentation
¶
Index ¶
- Variables
- type Watcher
- func (w *Watcher) GetEventDetailsWithCursorNodes(hitNodes []*watch.ChainNode, key event.Key) ([]string, error)
- func (w *Watcher) GetEventsWithCursorNodes(opts *watch.WatchEventOptions, hitNodes []*watch.ChainNode, key event.Key, ...) ([]*watch.WatchEventDetail, error)
- func (w *Watcher) GetHeadTailNodeTargetNode(key event.Key) (*watch.ChainNode, *watch.ChainNode, error)
- func (w *Watcher) GetHitNodeWithEventType(nodes []*watch.ChainNode, typs []watch.EventType) []*watch.ChainNode
- func (w *Watcher) GetLatestEventDetail(key event.Key) (node *watch.ChainNode, detail string, err error)
- func (w *Watcher) GetNodesFromCursor(count int, startCursor string, key event.Key) ([]*watch.ChainNode, error)
- func (w *Watcher) WatchFromNow(key event.Key, opts *watch.WatchEventOptions, rid string) (*watch.WatchEventDetail, error)
- func (w *Watcher) WatchWithCursor(key event.Key, opts *watch.WatchEventOptions, rid string) ([]*watch.WatchEventDetail, error)
- func (w *Watcher) WatchWithStartFrom(key event.Key, opts *watch.WatchEventOptions, rid string) ([]*watch.WatchEventDetail, error)
Constants ¶
This section is empty.
Variables ¶
var ( NoEventsError = errors.New(noEventWarning) HeadNodeNotExistError = errors.New(headNodeNotExistError) TailNodeNotExistError = errors.New(tailNodeNotExistError) TailNodeTargetNotExistError = errors.New(tailNodeTargetNotExistError) StartCursorNotExistError = errors.New(startCursorNotExistError) )
Functions ¶
This section is empty.
Types ¶
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher is resource events watcher in eventserver.
func NewWatcher ¶
NewWatcher creates a new Watcher object.
func (*Watcher) GetEventDetailsWithCursorNodes ¶
func (w *Watcher) GetEventDetailsWithCursorNodes(hitNodes []*watch.ChainNode, key event.Key) ([]string, error)
GetEventDetailsWithCursorNodes gets event detail strings base on target hit chain nodes.
func (*Watcher) GetEventsWithCursorNodes ¶
func (*Watcher) GetHeadTailNodeTargetNode ¶
func (*Watcher) GetHitNodeWithEventType ¶
func (*Watcher) GetLatestEventDetail ¶
func (*Watcher) GetNodesFromCursor ¶
func (w *Watcher) GetNodesFromCursor(count int, startCursor string, key event.Key) ([]*watch.ChainNode, error)
GetNodesFromCursor get node start from a cursor, the return result do not contain this cursor's value.
func (*Watcher) WatchFromNow ¶
func (w *Watcher) WatchFromNow(key event.Key, opts *watch.WatchEventOptions, rid string) (*watch.WatchEventDetail, error)
WatchFromNow watches target resource events from now.
func (*Watcher) WatchWithCursor ¶
func (w *Watcher) WatchWithCursor(key event.Key, opts *watch.WatchEventOptions, rid string) ([]*watch.WatchEventDetail, error)
watchWithCursor get events with the start cursor which is offered by user. it will hold the request for timeout seconds if no matched event is hit. if event has been hit in a round, then events will be returned immediately. if no events hit, then will loop the event every 200ms until timeout and return with a special cursor named "NoEventCursor", then we will help the user watch event from the head cursor.
func (*Watcher) WatchWithStartFrom ¶
func (w *Watcher) WatchWithStartFrom(key event.Key, opts *watch.WatchEventOptions, rid string) ([]*watch.WatchEventDetail, error)
WatchWithStartFrom watches target resource base on timestamp.