Default to bolt db proper
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
package config
|
package config
|
||||||
|
|
||||||
import "local/args"
|
import (
|
||||||
|
"io/ioutil"
|
||||||
|
"local/args"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Port int
|
Port int
|
||||||
@@ -14,8 +18,14 @@ type Config struct {
|
|||||||
func New() Config {
|
func New() Config {
|
||||||
as := args.NewArgSet()
|
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.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, "fileprefix", "path prefix for file service", "/__files__")
|
||||||
as.Append(args.STRING, "fileroot", "path to file hosting root", "/tmp/")
|
as.Append(args.STRING, "fileroot", "path to file hosting root", "/tmp/")
|
||||||
as.Append(args.STRING, "database", "database name to use", "db")
|
as.Append(args.STRING, "database", "database name to use", "db")
|
||||||
|
|||||||
Reference in New Issue
Block a user