Skip to content

Commit

Permalink
UPT: readme and makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Tang committed Jul 21, 2019
1 parent 7c14f4a commit 15acd04
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 12 deletions.
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@

# End of https://www.gitignore.io/api/go

tusc
tusc_darwin_amd64
tusc_linux_amd64
tusc_linux_arm
/data
/tusc
/tusc_darwin_amd64
/tusc_linux_amd64
/tusc_linux_arm

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.PHONY: all
all: get
all: clean get
GOOS=windows GOARCH=amd64 go build -ldflags "-w -s" -o tusc_windows_amd64.exe cmd/tusc.go
GOOS=darwin GOARCH=amd64 go build -ldflags "-w -s" -o tusc_darwin_amd64 cmd/tusc.go
GOOS=linux GOARCH=amd64 go build -ldflags "-w -s" -o tusc_linux_amd64 cmd/tusc.go
Expand Down
51 changes: 44 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

![build status](https://travis-ci.com/jackhftang/tusc.svg?branch=master)

A single binary for both server and client of [tus resumable upload protocol](https://tus.io)
A single binary for both server and client of [tus resumable upload protocol](https://tus.io).
This is a trim-down version of [tusd](https://github.com/tus/tusd) in favor of smaller binary size (< 10 MB rather than > 30MB).
S3, GCS, Prometheus, Hooks are not include. For client part, this a is command line implementation of [go-tusd](https://github.com/eventials/go-tus).

### Quick start on local
### Quick Start

Start server

Expand All @@ -16,13 +18,48 @@ Create and upload a file

```bash
$ echo test > test.txt
$ tusc client http://127.0.0.1:8080 text.txt
$ tusc client http://127.0.0.1:8080/files/ text.txt # not resumable
$ tusc client http://127.0.0.1:8080/files/ text.txt -r # resumable
```

## Server
## Server Options

The implementation is a wrapper of [tusd](https://github.com/tus/tusd)

## Client
```bash
$ tusc s --help
tusc server

Usage:
tusc (server|s) [options]
tusc (server|s) --help

Options:
-u --url URL Url of HTTP server [default: http://localhost:1080]
-b --bind ADDR Address to bind HTTP server to [default: 0.0.0.0]
-p --port PORT Port to bind HTTP server to [default: 1080]
-d --dir PATH Directory to store uploads in [default: ./data]
--listing-endpoint PATH Http path for flies listing [default: /]
--files-endpoint PATH Http path for files [default: /files/]
--unix-sock PATH If set will listen to a UNIX socket at this location instead of a TCP socket
--max-size SIZE Maximum size of a single upload in bytes [default: 0]
--store-size BYTE Size of space allowed for storage [default: 0]
--timeout TIMEOUT Read timeout for connections in milliseconds. A zero value means that reads will not timeout [default: 30*1000]
--behind-proxy Respect X-Forwarded-* and similar headers which may be set by proxies [default: false]
```
## Client Options
The implementation is a wrapper of [go-tusd](https://github.com/eventials/go-tus)
```bash
$ tusc c --help
tusc client

Usage:
tusc (client|c) <url> <file> [options]
tusc (client|c) --help

Options:
-r --resumable Save meta data in store for resumable uploads
--store PATH Path to save meta data for resume [default: ./.tusc]
--chuck-size BYTE Size of chucks of file [default: 2097152]
--override-patch-method Sending a POST request instead of PATCH [default: false]
```

0 comments on commit 15acd04

Please sign in to comment.