Clever/pathio — pull request #1 by kvigen (2014-09-03 01:44:33+00:00)
Title: pathio supports writing to and reading from different types of paths

transparently. It supports two types currently:
1. Local file paths
2. S3 File Paths

It has both a read and a write interface. I've tested the interface for
both of the workers I need it for (oplog-dump / oplog-replay) and it
works nicely for both of them.

Unfortunately, since the go s3 library we're using needs to know the
length of a file before starting to upload it (or at least needs to have
a seekable reader) we have to expose a less than ideal writer interface.
If we returned an io.Writer (as would be ideal) we would need to buffer
all its data into memory until we determined the length and only then
start sending it to s3.

So, instead we provide a writer interface that
takes in a reader which seems both reasonable and can be transformed by
the caller using io.Pipe()