fw

package
v1.8.85 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: LGPL-3.0 Imports: 7 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 {

	// 事件处理函数
	OnCreate func(string)
	OnWrite  func(string)
	OnRemove func(string)
	OnRename func(string)
	OnChmod  func(string)
	// contains filtered or unexported fields
}

FileWatcher 文件监控操作类

func NewFileWatcher

func NewFileWatcher(includeExts []string) (*FileWatcher, error)

NewFileWatcher 添加要监控的目录,支持递归子目录

func (*FileWatcher) AddDirRecursive added in v1.8.81

func (fw *FileWatcher) AddDirRecursive(path string) error

AddDirRecursive 递归地添加目录及其子目录到监控列表

func (*FileWatcher) Close

func (fw *FileWatcher) Close() error

Close 停止文件监控并释放资源

func (*FileWatcher) Start

func (fw *FileWatcher) Start()

Start 启动文件监控的主循环,并处理监控事件

func (*FileWatcher) WatchFile

func (fw *FileWatcher) WatchFile(path string) error

WatchFile 开始监控文件或目录 如果监控的目录不存在,则会自动创建该目录

Jump to

Keyboard shortcuts

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