catalyst-zero/middleware-server — pull request #27 by zyndiecate (2014-11-19 19:43:22+00:00)
Title: basic request callbacks

Note, I did not found a better name for `request-callback`. Feedback welcome!

This introduces request callbacks providing the current `AccessEntry`, to do things before and after `HTTPServe`. One could use that to collect custom metrics. See the new example `request-callback` for usage.

This is how its basically looks like when you `curl` the example:

```bash
$ curl localhost:8080
This is the request-callback example.
```

This is the output of the example code:

```bash
$ ./request-callback.example
2014/11/19 19:35:56 request-callback.go:28: [DEBUG] This is the request-callback example. Try `curl localhost:8080` to see what happens.
2014/11/19 19:35:56 server.go:117: [INFO] starting service on 127.0.0.1:8080
2014/11/19 19:36:09 request-callback.go:16: [DEBUG] Pre-HTTP-Handler called!
2014/11/19 19:36:09 request-callback.go:20: [DEBUG] HTTP-Handler called!
2014/11/19 19:36:09 request-callback.go:25: [DEBUG] Post-HTTP-Handler called!
2014/11/19 19:36:09 logaccess.go:86: [INFO] GET / 200 38 1
```