Documentation ¶
Overview ¶
Package gfsnotify provides a platform-independent interface for file system notifications.
文件监控.
Index ¶
Constants ¶
View Source
const (
REPEAT_EVENT_FILTER_INTERVAL = 1 // (毫秒)重复事件过滤间隔
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Callback ¶
type Callback struct { Id int // 唯一ID Func func(event *Event) // 回调方法 Path string // 监听的文件/目录 // contains filtered or unexported fields }
注册的监听回调方法
type Event ¶
type Event struct { Path string // 文件绝对路径 Op Op // 触发监听的文件操作 Watcher *Watcher // 事件对应的监听对象 // contains filtered or unexported fields }
监听事件对象
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
监听管理对象
func New ¶
创建监听管理对象,主要注意的是创建监听对象会占用系统的inotify句柄数量,受到 fs.inotify.max_user_instances 的限制
Click to show internal directories.
Click to hide internal directories.