Skip to content

Commit

Permalink
formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Fiery committed Sep 4, 2015
1 parent c17d62b commit 8340bd5
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,30 @@ Concurrent monitoring service notifies file system changes by periodically scann
Developed for the use case when the target paths to be monitored are shared/mounted volumes where the file operations happen remotely.

### API
##### Event
#### Event
- `FileCreate`
- `FileRemove`
- `FileUpdate`
- `FileRename`

##### Notice
- `Name() string`
- `Type() Event`
- `Time() time.Time`
#### Notice
- `Name() string`
- `Type() Event`
- `Time() time.Time`

##### Monitor
- `Watch(path string, pattern []string, event... Event)`
- `Notices() <-chan Notice`

#### Monitor
- `Watch(path string, pattern []string, event... Event)`
- `Notices() <-chan Notice`


### Example
a simple kafka client built atop can be found in /example folder, work flow is as below:
- `go monitor.Watch(...)`
- `range` over `monitor.Notices()` to collect file change notices
- Sends messages over to kafka cluster under a predefined topic using `sarama.SyncProducer`.
- In the meantime, log to kafka cluster under `topic`.process.log topic using `sarama.AsyncProducer`.
a simple kafka client built atop can be found in /example folder, work flow is as below:
- `go monitor.Watch(...)`
- `range` over `monitor.Notices()` to collect file change notices
- Sends messages over to kafka cluster under a predefined topic using `sarama.SyncProducer`.
- In the meantime, log to kafka cluster under `topic`.process.log topic using `sarama.AsyncProducer`.

Inspired by sarama's [http\_sever](https://github.com/Shopify/sarama/tree/master/examples/http_server) example
Inspired by sarama's [http\_sever](https://github.com/Shopify/sarama/tree/master/examples/http_server) example


### Todo
Expand Down

0 comments on commit 8340bd5

Please sign in to comment.