Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DirWatcher ¶
type DirWatcher struct { Errors chan error Events chan Event // contains filtered or unexported fields }
DirWatcher allows to watch directories. DirWatcher returns an error when trying to watch files.
func NewDirWatcher ¶
func NewDirWatcher(logger *zap.SugaredLogger) (*DirWatcher, error)
func (*DirWatcher) Add ¶
func (dw *DirWatcher) Add(dirpath string) error
func (*DirWatcher) Remove ¶
func (dw *DirWatcher) Remove(dirpath string) error
type Event ¶
type Event struct { Path string `json:"path"` Name string `json:"name"` Operation Op `json:"operation"` // Timestamp is nanoseconds since epoch Timestamp int64 `json:"timestamp"` // Directory doesn't hold a valid value for the remove operation. // Because we can't stat a path that just got removed to find out // if it was a file or a dir that got removed. Directory bool `json:"isDir"` }
Click to show internal directories.
Click to hide internal directories.