type Watcher … // NewWatcher provides a new watcher for socket registration func NewWatcher(sockDir string, desiredStateOfWorld cache.DesiredStateOfWorld) *Watcher { … } // Start watches for the creation and deletion of plugin sockets at the path func (w *Watcher) Start(stopCh <-chan struct{ … } func (w *Watcher) init() error { … } // Walks through the plugin directory discover any existing plugin sockets. // Ignore all errors except root dir not being walkable func (w *Watcher) traversePluginDir(dir string) error { … } // Handle filesystem notify event. // Files names: // - MUST NOT start with a '.' func (w *Watcher) handleCreateEvent(event fsnotify.Event) error { … } func (w *Watcher) handlePluginRegistration(socketPath string) error { … } func (w *Watcher) handleDeleteEvent(event fsnotify.Event) { … }