updated readme & go formatted code

This commit is contained in:
Remco 2014-10-20 14:54:42 +02:00
parent 16ad1833d2
commit b8eaf23805
4 changed files with 92 additions and 91 deletions

View file

@ -1,6 +1,8 @@
# transfer.sh
Easy and fast file sharing from the command-line. This code contains the server with everything you need to create your own instance. Transfer.sh currently runs on top of Amazon S3. Other storage types will be added shortly.
Easy and fast file sharing from the command-line. This code contains the server with everything you need to create your own instance.
Transfer.sh support currently the s3 (Amazon S3) provider and local file system (local).
[![Build Status](https://travis-ci.org/dutchcoders/transfer.sh.svg?branch=master)](https://travis-ci.org/dutchcoders/transfer.sh)

View file

@ -38,19 +38,19 @@ import (
"github.com/golang/gddo/httputil/header"
"github.com/gorilla/mux"
"github.com/kennygrant/sanitize"
html_template "html/template"
"io"
"io/ioutil"
"strconv"
"log"
"math/rand"
"mime"
"net/http"
"os"
"path/filepath"
"strconv"
"strings"
"time"
html_template "html/template"
text_template "text/template"
"time"
)
func healthHandler(w http.ResponseWriter, r *http.Request) {

View file

@ -1,12 +1,12 @@
package main
import (
"io"
"github.com/goamz/goamz/s3"
"strconv"
"fmt"
"github.com/goamz/goamz/s3"
"io"
"os"
"path/filepath"
"strconv"
)
type Storage interface {
@ -23,7 +23,6 @@ func NewLocalStorage(basedir string) (*LocalStorage, error) {
return &LocalStorage{basedir: basedir}, nil
}
func (s *LocalStorage) Get(token string, filename string) (reader io.ReadCloser, contentType string, contentLength uint64, err error) {
path := filepath.Join(s.basedir, token, filename)