Documentation ¶
Index ¶
- func Exit()
- func Remove(path string) error
- func RemoveCallback(callbackId int) error
- type Callback
- type Event
- type Op
- type Watcher
- func (that *Watcher) Add(path string, callbackFunc func(event *Event), recursive ...bool) (callback *Callback, err error)
- func (that *Watcher) AddOnce(name, path string, callbackFunc func(event *Event), recursive ...bool) (callback *Callback, err error)
- func (that *Watcher) Close()
- func (that *Watcher) Remove(path string) error
- func (that *Watcher) RemoveCallback(callbackId int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Callback ¶
type Callback struct { Id int Func func(event *Event) Path string // contains filtered or unexported fields }
Callback 回调函数结构体
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher 监听文件变化
func (*Watcher) Add ¶
func (that *Watcher) Add(path string, callbackFunc func(event *Event), recursive ...bool) (callback *Callback, err error)
Add 添加文件路径的监视,并且绑定回调函数 如果传入的路径是目录,并且recursive为true,则执行递归监听 recursive默认是true
func (*Watcher) AddOnce ¶
func (that *Watcher) AddOnce(name, path string, callbackFunc func(event *Event), recursive ...bool) (callback *Callback, err error)
AddOnce 使用唯一的<name>添加path的监控,相同name多次监控,只会成功一次
func (*Watcher) RemoveCallback ¶
RemoveCallback 删除回调函数
Click to show internal directories.
Click to hide internal directories.