dirmonitor

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 5 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirMonitor

type DirMonitor struct {
	// contains filtered or unexported fields
}

DirMonitor monitor the 'write' events of all the files in a specified directory (not recursively) different files can bind different listen functions respectively

func NewDirMonitor

func NewDirMonitor(dirPath string) (*DirMonitor, error)

NewDirMonitor initiate with a specified directory path

func NewDirMonitorRecursively

func NewDirMonitorRecursively(dirPath string) (*DirMonitor, error)

NewDirMonitorRecursively initiate with a specified directory path and also including dirPath all child path

func (*DirMonitor) Bind

func (dm *DirMonitor) Bind(filename string, flf fileListenFunc)

Bind bind file to listen function must be called before StartWatch

func (*DirMonitor) BindAndExec

func (dm *DirMonitor) BindAndExec(filename string, flf fileListenFunc) error

BindAndExec bind file to listen function, and then execute the function must be called before StartWatch

func (*DirMonitor) BindAny

func (dm *DirMonitor) BindAny(dlf dirListenFunc)

BindAny bind all files to listen function must be called before StartWatch

func (*DirMonitor) BindAnyCsv

func (dm *DirMonitor) BindAnyCsv(dlf dirListenFunc)

BindAnyCsv bind all csv files to listen function must be called before StartWatch

func (*DirMonitor) StartWatch

func (dm *DirMonitor) StartWatch() error

StartWatch start the monitor must be called once after all the Bind & BindAndExec methods have been called

Jump to

Keyboard shortcuts

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