kr/s3 — pull request #23 by schmichael (2013-12-21 02:11:29+00:00)
Title: Add the ability to pause/resume s3util uploads

Problem:

Right now there's no way to gracefully shutdown a process mid-upload. The upload struct is private - as are a number of key pieces of state.

Proposed Solution:

Add a Pause method and a Resume function to allow for graceful shutdowns and starting back up.

Implementation details:

* The return value of Pause, UploaderState, makes every field public to allow users to marshal it as they see fit. (Although I haven't written custom marshaling code yet, so I wonder if the ``part`` type will need to be made public to support some use cases.)
* Resume requires a Config in addition to the UploaderState since http clients can't be automatically marshalled (not to mention callers may not want their sensitive credentials included in the uploader state).
* I wrote a number of integration tests locally using my own S3 keys, but I didn't commit them because they're slow and require S3 keys. If you're curious, here's most of the code: https://gist.github.com/schmichael/a888d7ce5a0a9182d7c9