3
0
Denis Arh 5a9bce44e8 Cleanup internal, vendors, cleanup cmd/*
Introduces /pkg for non-intenral packages
2019-05-24 12:44:56 +02:00

27 lines
471 B
Go

package flags
import (
"github.com/spf13/cobra"
)
type (
DBOpt struct {
DSN string
Profiler string
}
)
func DB(cmd *cobra.Command, pfix string) (o *DBOpt) {
o = &DBOpt{}
bindString(cmd, &o.DSN,
pFlag(pfix, "db-dsn"), "corteza:corteza@tcp(db:3306)/corteza?collation=utf8mb4_general_ci",
"DSN for database connection")
bindString(cmd, &o.Profiler,
pFlag(pfix, "db-profiler"), "none",
"Profiler for DB queries (none, stdout, logger)")
return
}