MCPcopy Create free account
hub / github.com/VersusControl/devops-ai-guidelines / New

Function New

02-mcp-for-devops/code/07/pkg/watch/watcher.go:55–62  ·  view source on GitHub ↗

New constructs a Watcher with the given resync period (use 0 to disable).

(clientset kubernetes.Interface, resync time.Duration)

Source from the content-addressed store, hash-verified

53
54// New constructs a Watcher with the given resync period (use 0 to disable).
55func 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.
65func (w *Watcher) Subscribe(fn Subscriber) func() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected