Skip to content

Commit e3c00a7

Browse files
committed
Merge branch 'main' of github.com:studyplace-io/file-watcher
2 parents 8c6a552 + 2bb50cf commit e3c00a7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
### file-watcher 文件兼听器
1+
### file-watcher 文件监听器
22

33
### 介绍
4-
`file-watcher`是基于golang实现的文件兼听器,支持`Create` `Rename` `Write` `Remove`事件,并生成对应的k8s事件。
4+
`file-watcher`是基于golang实现的文件监听器,当文件有任何变更时,会产生事件,支持`Create` `Rename` `Write` `Remove`事件,并生成对应的k8s事件。
55
![](https://github.com/studyplace-io/file-watcher/blob/main/image/%E6%97%A0%E6%A0%87%E9%A2%98-2023-08-10-2343.png?raw=true)
66
### 项目功能
77
- 自定义监听多个文件(使用空格分隔)
88
- 生成k8s event(事件)(`Create` `Rename` `Write` `Remove`事件)
99

1010

1111
### 项目启动
12-
- 使用
12+
- 使用方法
1313
```bash
14+
# go run cmd/main.go <文件路径1> <文件路径2>
1415
➜ file-watcher git:(main) go run cmd/main.go test.txt test11.yaml
1516
I0910 11:55:06.031217 55434 init_k8s_config.go:33] run outside the cluster
1617
I0910 11:55:06.033137 55434 watcher.go:36] Start watching files: /Users/zhenyu.jiang/go/src/golanglearning/new_project/file-watcher/test.txt
@@ -27,6 +28,7 @@ I0910 11:55:34.411631 55434 event_generator.go:100] Event generated successful
2728

2829
```
2930

31+
- 生成对应的event事件类型
3032
```bash
3133
➜ .kube kubectl get event
3234
LAST SEEN TYPE REASON OBJECT MESSAGE

0 commit comments

Comments
 (0)