heroku/logplex — pull request #8 by archaelus (2012-04-14 01:03:43+00:00)
Title: V2 api 2

So - this is the api-v2 branch with bits and pieces moved around:

* The channel info stuff moved out of channels and into api - this is because the format the API wants to return may change, while the info that logplex_channel needs to compile will not (just drains+tokens).
* The v2 api now responds 404 to not-found channels
* The drain->url now happens in the drain module

Some tidying
* timer:tc/2 instead of timer:now_diff with manual timestamps. Gets us the time and result in one call.

In future I guess it'd be nice to move a bunch of this stuff to a cowboy rest resource - that way we just have to implement some callbacks and the REST logic gets done for us. Also allows us to support different content-types more easily. One thing I noted while looking at the code is that we respond text/html for all results, including json and plain text if I'm reading the code right.