Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/changsz/filewatch
Filewatch 是一个文件监控&内容收集器
https://github.com/changsz/filewatch
Last synced: 23 days ago
JSON representation
Filewatch 是一个文件监控&内容收集器
- Host: GitHub
- URL: https://github.com/changsz/filewatch
- Owner: ChangSZ
- Created: 2024-01-22T06:26:18.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-02-19T08:22:16.000Z (11 months ago)
- Last Synced: 2024-06-22T15:19:10.908Z (6 months ago)
- Language: Go
- Size: 6.84 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# filewatch
[中文](./README_cn.md)filewatch is a file harvester, mostly used to fetch logs files and feed them into other components.
## Quick start
```go
package mainimport (
"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!