Skip to content

Filewatch 是一个文件监控&内容收集器

Notifications You must be signed in to change notification settings

ChangSZ/filewatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

filewatch

中文

filewatch is a file harvester, mostly used to fetch logs files and feed them into other components.

Quick start

package main

import (
	"fmt"

	"github.com/ChangSZ/filewatch"
)

func main() {
	watcher := filewatch.NewWatcher()
	watcher.SetCompleteMarker("***")
	watcher.SetFileRegexp(`\d+.log`)
	watcher.SetWatchDir("./logs")
	watcher.SetRemoveAfterComplete(true)

	go func() {
		for info := range watcher.GetResChan() {
			fmt.Printf("%+v\n", info)
		}
	}()
	watcher.Start()
}

Contributions

If you have an issue, found a bug or have a feature request, go ahead!

About

Filewatch 是一个文件监控&内容收集器

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages