Skip to content

Releases

v2.0.0

Choose a tag to compare

@bdragon300 bdragon300 released this 21 Oct 12:40
1300639

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.

v0.3.0

Choose a tag to compare

@bdragon300 bdragon300 released this 12 Oct 09:21
cf5664a

New features

  • New field Client.ExtraHeaders to set HTTP request headers in more convenient way (#5)

Fixes

  • Bad formatting and panic while returning the error (#4)
  • Data loss in UploadStream in chunked mode when server acknowledges less bytes than ChunkSize in the middle of transmission: #10
  • Handle zero offset advance in server responses (#29)
  • Response body returned from tusRequest is not closed on HTTP 412 response (#13)
  • UploadStream.Seek sets offset more than RemoteSize (#12)
  • Panic on attempt to use some hash algorithms (#11)
  • GetUpload clobbers the caller's Upload on a metadata parse error (#14)
  • EncodeMetadata accepts comma in keys (#38)

Other

  • Improve documentation and readme (#15)
  • e2e tests (#37)

v0.2.0

Choose a tag to compare

@bdragon300 bdragon300 released this 29 May 15:14
5a12337

Fixed

Fix returning the closed body in HTTP responses (#2)

v0.1.2

Choose a tag to compare

@bdragon300 bdragon300 released this 10 Nov 08:58

Fixed

  • Bump test dependencies