Repository navigation
This is a new major library release and is not backward compatible with 0.x. The goal of this release was to make the API more natural for using in Go code and fix some old bad parts in the code.
Client methods now return (result, error) instead of filling the caller-provided objects and they don't return HTTP responses -- use Client.DoRequest callback to access the responses. Uploads are addressed by their location in some methods. Also, TusError now have attached an HTTP response that caused the error.
The old all-in-one UploadStream has been split into two building blocks. Stream is a low-level unbuffered io.Writer that implements the uploading sequence. ChunkedWriter adds resumable chunked buffering that works with utils from Go stdlib and can resume a failed transfer. You can also build your own buffering on top of Stream, and write your own retry strategy with the help of new util IsErrorRetryable.
NewClient takes only the endpoint URL. You can intercept every request through Client.DoRequest for tracing, logging or speed limiting. The protocol version and server capabilities are negotiated automatically. Underlying HTTP client now is an interface, that enables to substitute your own client implementation.
Some old weak spots are also fixed. For example, workflow for uploads with deferred size is now much simpler and user can declare its size by calling the Client.DeclareSize at any point instead of the first request.
And many other smaller fixes have landed in this release.
See "migration notes" section in the README for the full list of changes and upgrade steps from version 0.x.