lonelycode/tyk — pull request #19 by alexwhitman (2014-11-14 10:05:47+00:00)
Title: Don't create analytics for requests from specified IPs

Here's a first go at solving #18. There's a couple of things I don't really like:

The config uses a map of string to bool so that it's easy to do a `config.AnalyticsConfig.IgnoredIPs[ip]` check but that means the json has to be
```json
ignored_ips: {
"127.0.0.1": true
}
```
when it should really be using an array of strings
```json
ignored_ips: [
"127.0.0.1"
]
```
I can change it to do that but it means adding a 'in array' function as go doesn't appear to ship with one.

Also I'm not keen on the repeated code to get and check the ip. This could be refactored into a function so the if statement becomes something like `if StoreAnalytics() {` but I'm not sure where that function should be placed, I'm assuming `middleware.go`?