lss

command module
v0.0.0-...-7d7a4ac Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2017 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Light Storage Service

GoDoc Go Report Card License Docker Automated build

LSS is a simple web storage API.

Requirements

  • Golang 1.7.x

Installation

$ go get github.com/Masterminds/glide
$ glide install

Usage

API Reference
Upload a file (multipart/form-data)
POST /my_directory/file.txt

Attributes:

name value
file binary file
List files
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"
  }
}
Check if a file or directory exists
HEAD /my_directory/file.txt

200 OK or 404 Not Found

Metadata of a file or a directory
GET /my_directory/file.txt?metadata
{
  "directory": false,
  "size": 585,
  "updated_at": "2017-01-16T10:08:06+01:00"
}
Download a file
GET /my_directory/file.txt
Lorem ipsum dolor sit amet
Configuration

Environment variables:

  • LSS_WORKSPACE (default: ./workspace)
  • LSS_UPLOAD_SIZE_LIMIT (default: 8G)
  • LSS_ROUTER_NAMESPACE (default: "" ; e.g. /lss)
Development
$ 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 {} \;
Production
$ go build -o lss lss.go
$ ./lss -p 4005 -w /data
  • Docker
$ docker run -p 8888:8080 -v /my_data:/data -d mdouchement/lss

License

MIT

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
web

Jump to

Keyboard shortcuts

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