added todo

This commit is contained in:
Adnan Hajdarevic 2015-02-04 23:40:03 +01:00
parent d6d9b405ab
commit 478d189de8

View file

@ -11,10 +11,10 @@ $ go get github.com/adnanh/webhook
```go ```go
$ go get -u github.com/adnanh/webhook $ go get -u github.com/adnanh/webhook
``` ```
## Adding hooks ## Adding hooks
Hooks are defined using JSON format. The _hooks file_ must contain an array of JSON formatted hooks. Here is an example of a valid _hooks file_ containing only one hook. The hook will be triggered whenever a push to the master branch occurrs. Hooks are defined using JSON format. The _hooks file_ must contain an array of JSON formatted hooks. Here is an example of a valid _hooks file_ containing only one hook. The hook will be triggered whenever a push to the master branch occurrs.
```json ```json
[ [
{ {
@ -37,8 +37,8 @@ Hooks are defined using JSON format. The _hooks file_ must contain an array of J
### And ### And
*And rule* will evaluate to _true_, if and only if all of the sub rules evaluate to _true_. *And rule* will evaluate to _true_, if and only if all of the sub rules evaluate to _true_.
```json ```json
{ {
"and": "and":
[ [
{ {
"match": "match":
@ -60,8 +60,8 @@ Hooks are defined using JSON format. The _hooks file_ must contain an array of J
### Or ### Or
*Or rule* will evaluate to _true_, if any of the sub rules evaluate to _true_. *Or rule* will evaluate to _true_, if any of the sub rules evaluate to _true_.
```json ```json
{ {
"or": "or":
[ [
{ {
"match": "match":
@ -136,3 +136,9 @@ To override any of these options, you can use the following command line flags:
All hooks are served under the `http://ip:port/hook/:id`, where the `:id` corresponds to the hook *id* specified in _hooks file_. All hooks are served under the `http://ip:port/hook/:id`, where the `:id` corresponds to the hook *id* specified in _hooks file_.
Visiting `http://ip:port` will show version, uptime and number of hooks the webhook is serving. Visiting `http://ip:port` will show version, uptime and number of hooks the webhook is serving.
## Todo
* Add support for passing parameters from payload to the command that gets executed as part of the hook
* Add support for ip white/black listing
* Add "match-regex" rule
* ???