New constructs a Watcher with the given resync period (use 0 to disable).
(clientset kubernetes.Interface, resync time.Duration)
| 53 | |
| 54 | // New constructs a Watcher with the given resync period (use 0 to disable). |
| 55 | func New(clientset kubernetes.Interface, resync time.Duration) *Watcher { |
| 56 | return &Watcher{ |
| 57 | clientset: clientset, |
| 58 | factory: informers.NewSharedInformerFactory(clientset, resync), |
| 59 | resync: resync, |
| 60 | stopCh: make(chan struct{}), |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | // Subscribe registers a callback. The returned function unsubscribes. |
| 65 | func (w *Watcher) Subscribe(fn Subscriber) func() { |
nothing calls this directly
no outgoing calls
no test coverage detected