go-dropbox
go-dropbox copied to clipboard
Implemented upload session APIs (multi-part uploads)
Changes
- implemented upload session APIs (multi-part uploads)
- ~~implemented auto-handled upload session method
UploadSession()
~~ (see go-dropy) - renamed internal
download()
tocontent()
("Content-upload endpoints" and "Content-download endpoints") - added internal
decodeContent()
helper - fixed
PermanentlyDelete
endpoint path (not sure if it was incorrect on purpose?)
Notes
- Methods should probably use value parameters, as pointer parameters allow property changes after the call has been made. Also, it's good practise to use values where possible. However, I thought it was more important to follow the current method layout.
- As an alternate API to reduce the size of
files.go
, the raw upload session methods (start/append/finish) could be moved tofiles_upload_session.go
and then would becomeFiles.UploadSession.Start()
,.Append()
,.Finish()
- though we'd have to renameUploadSession()
to something else. - As an additional feature, we could add a
PerformRetries bool
so if any chunk failed, it would be retransmitted. This would require aChunkSize
buffer though to hold data in case of failure and maybe the Dropbox API doesn't fail that often so it might not be worth it...
# cd .; git clone https://github.com/davecgh/go-spew /home/runner/workspace/src/github.com/davecgh/go-spew
Cloning into '/home/runner/workspace/src/github.com/davecgh/go-spew'...
error: RPC failed; curl 56 GnuTLS recv error (-9): A TLS packet with unexpected length was received.
Strange failure, maybe manually retry?
Ah yes, just remembered https://github.com/tj/go-dropbox/issues/2. So maybe the higher-level UploadSession()
should go in go-dropy
?
niceee, yea as much as possible I think the fancier stuff should be in go-dropy
Striped out high-level UploadSession()
method, moved to go-dropy, see jpillora/go-dropy@5eee26d - Will PR it over there once this lands.
Adding new test with manually managed session upload...
Semaphore seems to be a bit buggy, https://semaphoreci.com/tj/go-dropbox/branches/pull-request-18/builds/4 also failed strangely
I'll sync with upstream again once #17 tests are fixed