watcher

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileWatcher

type FileWatcher struct {
	LastModify int64  //上次变更时间戳(秒)
	FilePath   string //文件路径
	// contains filtered or unexported fields
}

func NewFileWatcher

func NewFileWatcher(filePath string) *FileWatcher

创建监听器

func (*FileWatcher) OnChmodEvent

func (w *FileWatcher) OnChmodEvent(f func(fsnotify.Event))

设置权限修改事件

func (*FileWatcher) OnCreateEvent

func (w *FileWatcher) OnCreateEvent(f func(fsnotify.Event))

设置创建事件

func (*FileWatcher) OnRemoveEvent

func (w *FileWatcher) OnRemoveEvent(f func(fsnotify.Event))

设置移除事件

func (*FileWatcher) OnRenameEvent

func (w *FileWatcher) OnRenameEvent(f func(fsnotify.Event))

设置重命名事件

func (*FileWatcher) OnWriteEvent

func (w *FileWatcher) OnWriteEvent(f func(fsnotify.Event))

设置写事件

func (*FileWatcher) Start

func (w *FileWatcher) Start()

开始监听

func (*FileWatcher) Stop

func (w *FileWatcher) Stop()

停止监听

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL