MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / NewWatcher

Function NewWatcher

internal/prd/watcher.go:28–42  ·  view source on GitHub ↗

NewWatcher creates a new Watcher for the given PRD file path.

(path string)

Source from the content-addressed store, hash-verified

26
27// NewWatcher creates a new Watcher for the given PRD file path.
28func NewWatcher(path string) (*Watcher, error) {
29 fsWatcher, err := fsnotify.NewWatcher()
30 if err != nil {
31 return nil, err
32 }
33
34 w := &Watcher{
35 path: path,
36 watcher: fsWatcher,
37 events: make(chan WatcherEvent, 10),
38 done: make(chan struct{}),
39 }
40
41 return w, nil
42}
43
44// Start begins watching the PRD file for changes.
45func (w *Watcher) Start() error {

Callers 8

NewAppWithOptionsFunction · 0.92
switchToPRDMethod · 0.92
TestNewWatcherFunction · 0.85
TestWatcherStartFunction · 0.85
TestWatcherStopFunction · 0.85

Calls

no outgoing calls

Tested by 6

TestNewWatcherFunction · 0.68
TestWatcherStartFunction · 0.68
TestWatcherStopFunction · 0.68