MCPcopy
hub / github.com/cortesi/devd / WatchRoutes

Function WatchRoutes

watch.go:82–92  ·  view source on GitHub ↗

WatchRoutes watches the route collection, and broadcasts changes through reloader.

(routes RouteCollection, reloader livereload.Reloader, excludePatterns []string, log termlog.Logger)

Source from the content-addressed store, hash-verified

80
81// WatchRoutes watches the route collection, and broadcasts changes through reloader.
82func WatchRoutes(routes RouteCollection, reloader livereload.Reloader, excludePatterns []string, log termlog.Logger) error {
83 c := make(chan []string, 1)
84 for i := range routes {
85 _, err := routes[i].Watch(c, excludePatterns, log)
86 if err != nil {
87 return err
88 }
89 }
90 go reloader.Watch(c)
91 return nil
92}

Callers 1

RouterMethod · 0.85

Calls 1

WatchMethod · 0.65

Tested by

no test coverage detected