diff --git a/config/config.go b/config/config.go index 77b5d42..179c5f3 100644 --- a/config/config.go +++ b/config/config.go @@ -1,6 +1,10 @@ package config -import "local/args" +import ( + "io/ioutil" + "local/args" + "os" +) type Config struct { Port int @@ -14,8 +18,14 @@ type Config struct { func New() Config { as := args.NewArgSet() + f, err := ioutil.TempFile(os.TempDir(), "bolt.db.*") + if err != nil { + panic(err) + } + f.Close() + as.Append(args.INT, "p", "port to listen on", 18114) - as.Append(args.STRING, "dburi", "database uri", "mongodb://localhost:27017") + as.Append(args.STRING, "dburi", "database uri", f.Name()) as.Append(args.STRING, "fileprefix", "path prefix for file service", "/__files__") as.Append(args.STRING, "fileroot", "path to file hosting root", "/tmp/") as.Append(args.STRING, "database", "database name to use", "db")