tpl/data: Clean up data namespace
authorCameron Moore <moorereason@gmail.com>
Tue, 2 May 2017 03:41:08 +0000 (22:41 -0500)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 2 May 2017 07:18:41 +0000 (09:18 +0200)
commit08c0de5cc37cd4e512268b8f72ec5a6c68cd5754
treee585c3d118a3e6ca1ef593ed4afc0cef3af65ef4
parent1cf2f3dc4fa81503485a73db21bfda6e965dee15
tpl/data: Clean up data namespace

- Move the main GetCSV and GetJSON into data.go.
- Add error returns to GetCSV and GetJSON.
- Add http client to Namespace for test mocking.
- Send accept headers on remote requests. Fixes #3395
- Return an error on non-2XX HTTP response codes and don't retry.
- Move cache tests to cache_test.go.
tpl/data/cache_test.go [new file with mode: 0644]
tpl/data/data.go
tpl/data/data_test.go [new file with mode: 0644]
tpl/data/resources.go
tpl/data/resources_test.go