MCPcopy
hub / github.com/cloudflare/cloudflared / NewFile

Function NewFile

watcher/file.go:14–24  ·  view source on GitHub ↗

NewFile is a standard constructor

()

Source from the content-addressed store, hash-verified

12
13// NewFile is a standard constructor
14func NewFile() (*File, error) {
15 watcher, err := fsnotify.NewWatcher()
16 if err != nil {
17 return nil, err
18 }
19 f := &File{
20 watcher: watcher,
21 shutdown: make(chan struct{}),
22 }
23 return f, nil
24}
25
26// Add adds a file to start watching
27func (f *File) Add(filepath string) error {

Callers 2

handleServiceModeFunction · 0.92
TestFileChangedFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestFileChangedFunction · 0.68