Skip to content

NICEXAI/fstask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fstask

Installation

Run the following command under your project:

go get -u github.com/NICEXAI/fstask

Basic Usage

If I want to listen for changes to the settings.yaml file and perform a response, you can:

	fsTask, err := fstask.New("./example/config")
	if err != nil {
		log.Println(err)
		return
	}
	defer fsTask.Close()

	fsTask.Add(fstask.Task{
		Rule:   ".*settings.yaml",
		Action: []string{"write"},
		Handle: func(event fsnotify.Event) {
			log.Println(event.Name, "config file change")
		},
	})

	fsTask.Wait()

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages