Fast & simple concurrent api-based file storage with token authentication made in Go.
Multiple actions within one request, say you are attempting to upload or download multiple files, will be done concurrently in order to speed up operations.
{Authorization : Bearer Your token}
PUT /api/uploadHeader:
| Parameter | Type | Description |
|---|---|---|
Authorization |
string |
Required. |
Body:
| Parameter | Type | Description |
|---|---|---|
file |
file |
Required. File to be uploaded |
PUT /api/multi-uploadHeader:
| Parameter | Type | Description |
|---|---|---|
Authorization |
string |
Required. |
Body:
| Parameter | Type | Description |
|---|---|---|
file |
file |
Required. First file |
file |
file |
Required. Second file |
file |
file |
Required. ... file |
GET /api/download/{filename}Header:
| Parameter | Type | Description |
|---|---|---|
Authorization |
string |
Required. |
DELETE /api/delete/{filename}Header:
| Parameter | Type | Description |
|---|---|---|
Authorization |
string |
Required. |
Downloads a zip of the requested files.
GET /api/multi-download?file=file1.jpg&file=file2.png...Header:
| Parameter | Type | Description |
|---|---|---|
Authorization |
string |
Required. |
Note: Files not found will be ingored, and their names will be added to the response header notifiying you they were not found.
DELETE /api/multi-delete?file=file1.jpg&file=file2.png...Header:
| Parameter | Type | Description |
|---|---|---|
Authorization |
string |
Required. |
Note: Files not found will be ingored, and their names will be added to the response header notifiying you they were not found.
To deploy this project run
go run main.goRemeber to set a the "token" env variable to be a proper randomized token before using this outside of testing, and removing os.Setenv("thisisatoken") in main.go, once you do. "thisisatoken" is the default token set by this line.