Initial commit

This commit is contained in:
2018-11-12 01:56:30 +00:00
committed by cdramey
parent 669da74e7e
commit 208e13d2a8
32 changed files with 5211 additions and 0 deletions

29
main.go Normal file
View File

@ -0,0 +1,29 @@
package main
import (
"flag"
"fmt"
"os"
"qurl/storage"
)
func main() {
dburl := flag.String("u", "bolt:./qurl.db", "url to database")
jsonfile := flag.String("j", "", "path to json to load into database")
flag.Parse()
stor, err := storage.NewStorage(*dburl)
if err != nil {
fmt.Fprintf(os.Stderr, "Database connection error: %s", err.Error())
return
}
defer stor.Shutdown()
if *jsonfile != "" {
err := loadjson(stor, *jsonfile)
if err != nil {
fmt.Fprintf(os.Stderr, "Load error: %s", err.Error())
return
}
}
}