Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventHandler ¶
type EventHandler interface {
HandleEvent(any interface{}) error
}
type EventMonitor ¶
type EventMonitor struct {
// contains filtered or unexported fields
}
EventMonitor monitors containerd event and updates internal state correspondingly.
func NewEventMonitor ¶
func NewEventMonitor(eventHandler EventHandler) *EventMonitor
NewEventMonitor create new event monitor. New event monitor will Start subscribing containerd event. All events happen after it should be monitored.
func (*EventMonitor) Backoff ¶
func (em *EventMonitor) Backoff(key string, evt interface{})
func (*EventMonitor) Start ¶
func (em *EventMonitor) Start() <-chan error
Start starts the event monitor which monitors and handles all subscribed events. It returns an error channel for the caller to wait for Stop errors from the event monitor.
NOTE:
- Start must be called after Subscribe.
- The task exit event has been handled in individual startSandboxExitMonitor or startContainerExitMonitor goroutine at the first. If the goroutine fails, it puts the event into backoff retry queue and event monitor will handle it later.
func (*EventMonitor) Stop ¶
func (em *EventMonitor) Stop()
Stop stops the event monitor. It will close the event channel. Once event monitor is stopped, it can't be started.
func (*EventMonitor) Subscribe ¶
func (em *EventMonitor) Subscribe(subscriber events.Subscriber, filters []string)
Subscribe starts to Subscribe containerd events.
Click to show internal directories.
Click to hide internal directories.