wip
parent
aa330dffea
commit
2b958fafe9
|
|
@ -11,6 +11,10 @@ import (
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Port int
|
Port int
|
||||||
Root string
|
Root string
|
||||||
|
DB struct {
|
||||||
|
Scheme string
|
||||||
|
Conn string
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewConfig() (Config, error) {
|
func NewConfig() (Config, error) {
|
||||||
|
|
@ -19,6 +23,8 @@ func NewConfig() (Config, error) {
|
||||||
|
|
||||||
fs.IntVar(&c.Port, "p", 8080, "port")
|
fs.IntVar(&c.Port, "p", 8080, "port")
|
||||||
fs.StringVar(&c.Root, "r", "/tmp/", "static file root")
|
fs.StringVar(&c.Root, "r", "/tmp/", "static file root")
|
||||||
|
fs.StringVar(&c.DB.Scheme, "db-scheme", "sqlite", "sql scheme")
|
||||||
|
fs.StringVar(&c.DB.Conn, "db-conn", "/tmp/out.sql", "sql conn string")
|
||||||
|
|
||||||
err := fs.Parse(os.Args[1:])
|
err := fs.Parse(os.Args[1:])
|
||||||
return c, err
|
return c, err
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue