New skeleton
This commit is contained in:
parent
36cda94bb6
commit
f25c3c71ae
|
@ -1 +1,2 @@
|
|||
/tus_data
|
||||
/gopath
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
# usage: source dev.sh
|
||||
#
|
||||
# dev.sh simplifies development by setting up a local GOPATH.
|
||||
export GOPATH=`pwd`/gopath
|
||||
src_dir="${GOPATH}/src/github.com/tus/tusd"
|
||||
mkdir -p "${src_dir}"
|
||||
ln -fs "`pwd`/src" "${src_dir}"
|
|
@ -2,13 +2,23 @@ package main
|
|||
|
||||
import (
|
||||
"log"
|
||||
tushttp "github.com/tus/tusd/src/http"
|
||||
"net/http"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
log.SetFlags(log.Ldate | log.Ltime | log.Lmicroseconds)
|
||||
log.Printf("tusd started")
|
||||
|
||||
if err := serveHttp(); err != nil {
|
||||
log.Fatal(err)
|
||||
addr := ":1080"
|
||||
if port := os.Getenv("TUSD_PORT"); port != "" {
|
||||
addr = ":" + port
|
||||
}
|
||||
log.Printf("servering clients at http://localhost%s", addr)
|
||||
|
||||
handler := tushttp.NewHandler()
|
||||
if err := http.ListenAndServe(addr, handler); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
package http
|
|
@ -0,0 +1,3 @@
|
|||
// Package http contains a client and server implementation of the tus protocol
|
||||
// and is meant to be used by other applications.
|
||||
package http
|
|
@ -0,0 +1,14 @@
|
|||
package http
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func NewHandler() *Handler {
|
||||
return &Handler{}
|
||||
}
|
||||
|
||||
type Handler struct {}
|
||||
|
||||
func (h *Handler) ServeHTTP(http.ResponseWriter, *http.Request) {
|
||||
}
|
Loading…
Reference in New Issue