Simple event sniffer

The master branch includes a tool to display events from syncthing as they happen. You install and use it like this to get a live event feed:

jb@jborg-mbp:~ $ go get github.com/calmh/syncthing/cmd/stevents
jb@jborg-mbp:~ $ stevents -target localhost:8080 -apikey MEKTJG842AVDJ8R...
{
    "id": 1,
    "type": "StartupComplete",
    "time": "2014-07-13T21:03:18.383239179+02:00",
    "data": null
}
{
    "id": 2,
    "type": "NodeConnected",
    "time": "2014-07-13T21:04:33.687836696+02:00",
    "data": {
        "addr": "172.16.32.25:22000",
        "id": "NFGKEKE-7Z6RTH7-I3PRZXS-DEJF3UJ-FRWJBFO-VBBTDND-4SGNGVZ-QUQHJAG"
    }
}
...

The code is also a demonstration of how to run the event poller (although it’s trivial - just a loop around an HTTP GET).