read support for length and offset

This commit is contained in:
Chapuis Bertil
2015-08-15 10:06:10 +02:00
parent 71163e75d1
commit 59621ca2d6
6 changed files with 321 additions and 62 deletions

View File

@@ -1,10 +1,28 @@
package main
import ()
import (
//"io/ioutil"
"log"
"net/http"
)
func main() {
//path, _ := ioutil.TempDir("", "restic-repository-")
//log.Printf("initialize context at %s", path)
//http.ListenAndServe(":8000", r)
context := Context{"/tmp/restic"}
repo, _ := context.Repository("repo")
repo.Init()
errc := context.Init()
if errc != nil {
log.Println("context initialization failed")
return
}
router := Router{context}
port := ":8000"
log.Printf("start server on port %s", port)
http.ListenAndServe(port, router)
}