MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / start

Method start

internal/watcher/events.go:29–46  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

27}
28
29func (w *Watcher) start(ctx context.Context) error {
30 if errAddConfig := w.watcher.Add(w.configPath); errAddConfig != nil {
31 log.Errorf("failed to watch config file %s: %v", w.configPath, errAddConfig)
32 return errAddConfig
33 }
34 log.Debugf("watching config file: %s", w.configPath)
35
36 if errAddAuthDir := w.watcher.Add(w.authDir); errAddAuthDir != nil {
37 log.Errorf("failed to watch auth directory %s: %v", w.authDir, errAddAuthDir)
38 return errAddAuthDir
39 }
40 log.Debugf("watching auth directory: %s", w.authDir)
41
42 go w.processEvents(ctx)
43
44 w.reloadClients(true, nil, false)
45 return nil
46}
47
48func (w *Watcher) processEvents(ctx context.Context) {
49 for {

Callers 2

StartMethod · 0.95
StartMethod · 0.80

Calls 2

processEventsMethod · 0.95
reloadClientsMethod · 0.95

Tested by

no test coverage detected