watchx

package
v0.0.0-...-afa1935 Latest Latest
Warning

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

Go to latest
Published: May 8, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendChangedToOutputFile

func AppendChangedToOutputFile(typeStr string, fileName string, isDir bool)

AppendChangedToOutputFile 追加变更历史

func IgnoreFile

func IgnoreFile(fileName string) bool

func LetItChanged

func LetItChanged(typeId int, fileName string)

func OutPutToFile

func OutPutToFile()

OutPutToFile 输出到指定文件中

func TimerCheck

func TimerCheck()

TimerCheck 定时检测

Types

type ActionPath

type ActionPath struct {
	Path       string
	ActionType fsnotify.Op
	Desc       string
	SourcePath string
	TargetPath string
}

ActionPath 文件操作

type NotifyFile

type NotifyFile struct {
	Watch *fsnotify.Watcher
	Path  chan ActionPath
}

NotifyFile 包的指针结构

func NewNotifyFile

func NewNotifyFile() *NotifyFile

NewNotifyFile 返回 fsnotify 对象指针

func (*NotifyFile) DeleteItWatcher

func (notifyFile *NotifyFile) DeleteItWatcher(path string)

DeleteItWatcher 从监控集合中删除

func (*NotifyFile) LetItWatcher

func (notifyFile *NotifyFile) LetItWatcher(path string)

LetItWatcher 加入监控集合中

func (*NotifyFile) PushEventChannel

func (notifyFile *NotifyFile) PushEventChannel(Path string, ActionType fsnotify.Op, desc string, source string, target string)

PushEventChannel 将发生事件加入 channel

func (*NotifyFile) WatchDir

func (notifyFile *NotifyFile) WatchDir(sourcePath string, targetPath string)

WatchDir a directory

func (*NotifyFile) WatchEvents

func (notifyFile *NotifyFile) WatchEvents(sourcePath string, targetPath string)

WatchEvents Handle the watch events 监控目录

Jump to

Keyboard shortcuts

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