tus-client

module
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2025 License: MIT

README

tus-client

Go Report Card

A command-line tus client.

See https://tus.io for more information.

Command Line Options

  • --chunksize: Chunks size for uploads (can be specified in bytes or with "Ki", "Mi", "Gi", "Ti", "Pi" or "Ei" suffix)
  • --disable-resume: Disable the resumption of uploads (disables the use of the store)
  • -H, --header: Extra HTTP header(s) to add to request (eg "Authorization: Bearer TOKEN"). Specify more than once to add multiple headers.
  • -h, --help: help for tus-client
  • -i, --input: File to upload
  • --no-progress: Disable progress bar
  • -q, --quiet: Disable all output except for errors
  • --storepath: Path of database or JSON file to allow resumable uploads (defaults to using SQLite store in a user specific OS dependent location)
  • --url: tus upload URL

Resumption of Uploads

The tus protocol supports resuming uploads, which is implemented using the tus.Store interface.

This repo includes two implementations of this interface, one supporting SQLite and the the other writing to a JSON file.

Depending on the extension provided for the --storepath option, either the SQLite or JSON store type will be used.

The default is to use the sqlitestore.Store implemention below, with the default path to the database dependent on the OS in question:

OS Location
Linux $XDG_CONFIG_HOME/tus-client/resume.db or $HOME/.config/tus-client/resume.db
Windows %APPDATA%\tus-client\resume.db or C:\Users\%USER%\AppData\Roaming\tus-client\resume.db
macOS $HOME/Library/Application Support/tus-client/resume.db
sqlitestore

GoDoc

This package is used to implement a SQLite version of the tus.Store interface.

jsonstore

GoDoc

This package is used to implement a JSON file-based version of the tus.Store interface.

Due to the simplisitic nature of this implementation, it is not safe to have multiple users of the same JSON file as a tus.Store.

Authentication

The tus protocol does not specify any Authentication/Authorization scheme, so this is up to the server implementation in question.

This client supports the addition of arbritrary HTTP headers to the request which allows various authentication options, as follows:

tus-client -H "Remote-User-Name: user" -H "Remote-User-Secret: SECRET-API-TOKEN" --input upload.mp4 --url https://some.tus.server/url

Or using "bearer" authentication:

tus-client -H "Authorization: Bearer SECRET-API-TOKEN" --input upload.mp4 --url https://some.tus.server/url

Directories

Path Synopsis
cmd
tus-client command
internal
pkg
boltstore
boltstore implements a go.etcd.io/bbolt based store for resumable uploads via github.com/eventials/go-tus
boltstore implements a go.etcd.io/bbolt based store for resumable uploads via github.com/eventials/go-tus
jsonstore
jsonstore implements a JSON file based store for resumable uploads via github.com/eventials/go-tus
jsonstore implements a JSON file based store for resumable uploads via github.com/eventials/go-tus
sqlitestore
sqlitestore implements an SQLite based store for resumable uploads via github.com/eventials/go-tus
sqlitestore implements an SQLite based store for resumable uploads via github.com/eventials/go-tus

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL