Skip to content

Commit b7cf00b

Browse files
committed
完善readme.md文档
1 parent 060e3e7 commit b7cf00b

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

README-zh.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### file-watcher 文件监听器
22
### 介绍
3-
`file-watcher`是基于golang实现的文件监听器,当文件有任何变更时,会产生事件,支持`Create` `Rename` `Write` `Remove`事件,并生成对应的k8s事件
3+
`file-watcher`是基于 golang 实现的文件监听器,当文件有任何变更时,会产生事件,支持`Create` `Rename` `Write` `Remove`事件,并生成对应的 k8s 集群内事件
44
![](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)
55
### 项目功能
66
- 自定义监听多个文件(使用空格分隔)

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
### file-watcher
22
<a href="./README.md">English</a> | <a href="./README-zh.md">简体中文</a>
33
### Introduction
4-
`file-watcher` is a file listener implemented based on golang. When there are any changes to the file, an event will be generated. It supports `Create` `Rename` `Write` `Remove` events and generates corresponding k8s events.
4+
- `file-watcher` is a file listener implemented based on golang. When there are any changes to the file, an event will be generated.
5+
6+
- It supports `Create` `Rename` `Write` `Remove` events and generates corresponding k8s events.
7+
58
![](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)
69
### Project support
710
- Customize monitoring of multiple files (separated by spaces)

cmd/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ func main() {
1111

1212
var rootCmd = &cobra.Command{
1313
Use: "file-watcher",
14-
Short: "run file-wather",
14+
Short: "run file-watcher",
1515
Run: func(cmd *cobra.Command, args []string) {
1616
// 启动事件监听器
1717
file_watcher.StartWatcher(cmd, args)

pkg/events/k8s_event_generator.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func getEventType(event fsnotify.Event) string {
5858
func (g *EventGenerator) SendEvent(ee fsnotify.Event) error {
5959
switch {
6060
case ee.Op&fsnotify.Create == fsnotify.Create:
61-
klog.Infof("File modified: %s\n", ee.Name)
61+
klog.Infof("File created: %s\n", ee.Name)
6262
case ee.Op&fsnotify.Write == fsnotify.Write:
6363
klog.Infof("File modified: %s\n", ee.Name)
6464
case ee.Op&fsnotify.Remove == fsnotify.Remove:

0 commit comments

Comments
 (0)