LSS is a simple web storage API.
- Golang 1.7.x
$ go get github.com/Masterminds/glide
$ glide install
POST /my_directory/file.txt
Attributes:
name | value |
---|---|
file | binary file |
GET /my_directory?list
{
"/my_directory": {
"directory": true,
"size": 102,
"updated_at": "2017-01-16T09:55:36+01:00"
},
"/my_directory/file.txt": {
"directory": false,
"size": 764,
"updated_at": "2017-01-16T09:55:36+01:00"
},
"/my_directory/depth/file.txt": {
"directory": false,
"size": 764,
"updated_at": "2017-01-16T09:55:36+01:00"
}
}
GET /my_directory?list&depth=1
{
"/my_directory": {
"directory": true,
"size": 102,
"updated_at": "2017-01-16T09:55:36+01:00"
},
"/my_directory/file.txt": {
"directory": false,
"size": 764,
"updated_at": "2017-01-16T09:55:36+01:00"
}
}
HEAD /my_directory/file.txt
200 OK
or 404 Not Found
GET /my_directory/file.txt?metadata
{
"directory": false,
"size": 585,
"updated_at": "2017-01-16T10:08:06+01:00"
}
GET /my_directory/file.txt
Lorem ipsum dolor sit amet
Environment variables:
LSS_WORKSPACE
(default:./workspace
)LSS_UPLOAD_SIZE_LIMIT
(default:8G
)LSS_ROUTER_NAMESPACE
(default:""
; e.g./lss
)
$ go run lss.go -h
$ go run lss.go server -b localhost -p 5000
# Or with live-reload
$ make live-reload # needs fswatch tool
# Before pushing to Github
$ find . -name '*.go' -not -path './vendor*' -exec go fmt {} \;
$ go build -o lss lss.go
$ ./lss -p 4005 -w /data
- Docker
$ docker run -p 8888:8080 -v /my_data:/data -d mdouchement/lss
MIT
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request