preparing for v0.5

This commit is contained in:
default
2024-08-01 10:06:42 +08:00
parent 24778d1093
commit 93359110a2
115 changed files with 5153 additions and 4395 deletions

View File

@@ -0,0 +1,25 @@
package watcher
import (
"context"
"path"
E "github.com/yusing/go-proxy/error"
)
type fileWatcher struct {
filename string
}
func NewFileWatcher(filename string) Watcher {
if path.Base(filename) != filename {
panic("filename must be a relative path")
}
return &fileWatcher{filename: filename}
}
func (f *fileWatcher) Events(ctx context.Context) (<-chan Event, <-chan E.NestedError) {
return fwHelper.Add(ctx, f)
}
var fwHelper = newFileWatcherHelper()