Skip to content

Commit 15acd04

Browse files
author
Jack Tang
committed
UPT: readme and makefile
1 parent 7c14f4a commit 15acd04

File tree

3 files changed

+51
-12
lines changed

3 files changed

+51
-12
lines changed

.gitignore

+6-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525

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

28-
tusc
29-
tusc_darwin_amd64
30-
tusc_linux_amd64
31-
tusc_linux_arm
28+
/data
29+
/tusc
30+
/tusc_darwin_amd64
31+
/tusc_linux_amd64
32+
/tusc_linux_arm
33+

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.PHONY: all
2-
all: get
2+
all: clean get
33
GOOS=windows GOARCH=amd64 go build -ldflags "-w -s" -o tusc_windows_amd64.exe cmd/tusc.go
44
GOOS=darwin GOARCH=amd64 go build -ldflags "-w -s" -o tusc_darwin_amd64 cmd/tusc.go
55
GOOS=linux GOARCH=amd64 go build -ldflags "-w -s" -o tusc_linux_amd64 cmd/tusc.go

README.md

+44-7
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

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

5-
A single binary for both server and client of [tus resumable upload protocol](https://tus.io)
5+
A single binary for both server and client of [tus resumable upload protocol](https://tus.io).
6+
This is a trim-down version of [tusd](https://github.com/tus/tusd) in favor of smaller binary size (< 10 MB rather than > 30MB).
7+
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).
68

7-
### Quick start on local
9+
### Quick Start
810

911
Start server
1012

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

1719
```bash
1820
$ echo test > test.txt
19-
$ tusc client http://127.0.0.1:8080 text.txt
21+
$ tusc client http://127.0.0.1:8080/files/ text.txt # not resumable
22+
$ tusc client http://127.0.0.1:8080/files/ text.txt -r # resumable
2023
```
2124

22-
## Server
25+
## Server Options
2326

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

26-
## Client
28+
```bash
29+
$ tusc s --help
30+
tusc server
31+
32+
Usage:
33+
tusc (server|s) [options]
34+
tusc (server|s) --help
35+
36+
Options:
37+
-u --url URL Url of HTTP server [default: http://localhost:1080]
38+
-b --bind ADDR Address to bind HTTP server to [default: 0.0.0.0]
39+
-p --port PORT Port to bind HTTP server to [default: 1080]
40+
-d --dir PATH Directory to store uploads in [default: ./data]
41+
--listing-endpoint PATH Http path for flies listing [default: /]
42+
--files-endpoint PATH Http path for files [default: /files/]
43+
--unix-sock PATH If set will listen to a UNIX socket at this location instead of a TCP socket
44+
--max-size SIZE Maximum size of a single upload in bytes [default: 0]
45+
--store-size BYTE Size of space allowed for storage [default: 0]
46+
--timeout TIMEOUT Read timeout for connections in milliseconds. A zero value means that reads will not timeout [default: 30*1000]
47+
--behind-proxy Respect X-Forwarded-* and similar headers which may be set by proxies [default: false]
48+
```
49+
50+
## Client Options
2751
28-
The implementation is a wrapper of [go-tusd](https://github.com/eventials/go-tus)
52+
```bash
53+
$ tusc c --help
54+
tusc client
55+
56+
Usage:
57+
tusc (client|c) <url> <file> [options]
58+
tusc (client|c) --help
59+
60+
Options:
61+
-r --resumable Save meta data in store for resumable uploads
62+
--store PATH Path to save meta data for resume [default: ./.tusc]
63+
--chuck-size BYTE Size of chucks of file [default: 2097152]
64+
--override-patch-method Sending a POST request instead of PATCH [default: false]
65+
```

0 commit comments

Comments
 (0)