monitor

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileMonitor

type FileMonitor struct {
	Path         string                // 监控的文件/目录路径
	Delay        time.Duration         // 执行命令的延时
	OnFileChange func(fm *FileMonitor) // 文件变化时的回调函数
	*ProcessInfo
}

FileMonitor 是文件监控组件的结构体

func NewFileMonitor

func NewFileMonitor(path string, onFileChange func(fm *FileMonitor)) *FileMonitor

NewFileMonitor 创建一个新的文件监控组件

func (*FileMonitor) Start

func (fm *FileMonitor) Start()

Start 启动文件监控服务

type ProcessInfo added in v0.0.5

type ProcessInfo struct {
	PreviousProcess *os.Process    // 上一次启动的进程
	Event           fsnotify.Event // 监听事件
}

Jump to

Keyboard shortcuts

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