top

Package notify implements access to filesystem events.

Notify is a high-level abstraction over filesystem watchers like inotify, kqueue, FSEvents, FEN or ReadDirectoryChangesW. Watcher implementations are split into two groups: ones that natively support recursive notifications (FSEvents and ReadDirectoryChangesW) and ones that do not (inotify, kqueue, FEN). For more details see watcher and recursiveWatcher interfaces in watcher.go source file.

On top of filesystem watchers notify maintains a watchpoint tree, which provides strategy for creating and closing filesystem watches and dispatching filesystem events to user channels.

An event set is just an event list joint using bitwise OR operator into a single event value.

A filesystem watch or just a watch is platform-specific entity which represents a single path registered for notifications for specific event set. Setting a watch means using platform-specific API calls for creating / initializing said watch. For each watcher the API call is:

- FSEvents: FSEventStreamCreate
- inotify:  notify_add_watch
- kqueue:   kevent
- ReadDirectoryChangesW: CreateFile+ReadDirectoryChangesW
- FEN:      port_get

To rewatch means to either shrink or expand an event set that was previously registered during watch operation for particular filesystem watch.

A watchpoint is a list of user channel and event set pairs for particular path (watchpoint tree's node). A single watchpoint can contain multiple different user channels registered to listen for one or more events. A single user channel can be registered in one or more watchpoints, recurisve and non-recursive ones as well.

Imported by 40 package(s)

  1. github.com/LicaSterian/unsub/users
  2. github.com/Travix-International/Travix.Core.Adk
  3. github.com/alecthomas/buildkit
  4. github.com/barakmich/livemd
  5. github.com/blackss2/utility/hotserver
  6. github.com/clarenceb/backend/watch
  7. github.com/cortesi/moddwatch
  8. github.com/cortex/gopass
  9. github.com/crackcomm/renderer/storage
  10. github.com/crackcomm/renderer/watcher
  11. github.com/cryptrol/nfa
  12. github.com/dwlnetnl/treewatch
  13. github.com/ekino/golisten
  14. github.com/fanyang1988/etcddir
  15. github.com/g8os/controller/jswatcher
  16. github.com/gliderlabs/gosper/com/dev
  17. github.com/hlandau/degoutils/web/assetmgr
  18. github.com/jonaz/devd/modd
  19. github.com/limetext/backend/watch
  20. github.com/lox/binarystar
  21. github.com/lox/golisten
  22. github.com/lucas-clemente/goldfish/git
  23. github.com/martinp/gounpack/dispatcher
  24. github.com/minio/mc/cmd
  25. github.com/mmatczuk/monitoring/check
  26. github.com/ncbray/crank/watch
  27. github.com/neil-ca-moore/language-tool
  28. github.com/nohupped/taken
  29. github.com/osuripple/hanayo
  30. github.com/pdxjohnny/freeze-tool/connected
  31. github.com/peppage/ComicLaser/monitor
  32. github.com/philpearl/watch
  33. github.com/rekby/etcddir
  34. github.com/rjeczalik/cmd/notify
  35. github.com/supiyun/devd
  36. github.com/thatguystone/acrylic
  37. github.com/unbalancedparentheses/stalk
  38. github.com/wangyuhere/devd/modd
  39. github.com/xpzouying/devd
  40. github.com/yml/degoutils/web/assetmgr

Imported only in test by 6 package(s)

  1. github.com/Fiery/notify
  2. github.com/adg/notify
  3. github.com/advanderveer/notify
  4. github.com/cortesi/notify
  5. github.com/fsnotify/notify
  6. github.com/pblaszczyk/notify