Update executables with new conn str
This commit is contained in:
parent
dc61d05584
commit
2992f7ae8e
@ -34,6 +34,7 @@ var (
|
||||
func init() {
|
||||
initializers.LoadEnvVariables()
|
||||
}
|
||||
|
||||
func main() {
|
||||
config.LoadConfig()
|
||||
|
||||
@ -47,15 +48,15 @@ func main() {
|
||||
var err error
|
||||
|
||||
flag.StringVar(&resourceDir, "resourcedir", path.Join("services", "registration"), "resource dir")
|
||||
flag.StringVar(&connStr, "c", ".", "connection string")
|
||||
flag.StringVar(&connStr, "c", ".state", "connection string")
|
||||
flag.BoolVar(&engineDebug, "d", false, "use engine debug output")
|
||||
flag.UintVar(&size, "s", 160, "max size of output")
|
||||
flag.StringVar(&host, "h", initializers.GetEnv("HOST", "127.0.0.1"), "http host")
|
||||
flag.UintVar(&port, "p", initializers.GetEnvUint("PORT", 7123), "http port")
|
||||
flag.Parse()
|
||||
|
||||
if connStr == "." {
|
||||
connStr, err = filepath.Abs(".state/state.gdbm")
|
||||
if connStr == ".state" {
|
||||
connStr, err = filepath.Abs(connStr)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "auto connstr generate error: %v", err)
|
||||
os.Exit(1)
|
||||
|
@ -59,15 +59,15 @@ func main() {
|
||||
|
||||
flag.StringVar(&sessionId, "session-id", "075xx2123", "session id")
|
||||
flag.StringVar(&resourceDir, "resourcedir", path.Join("services", "registration"), "resource dir")
|
||||
flag.StringVar(&connStr, "c", ".", "connection string")
|
||||
flag.StringVar(&connStr, "c", ".state", "connection string")
|
||||
flag.BoolVar(&engineDebug, "d", false, "use engine debug output")
|
||||
flag.UintVar(&size, "s", 160, "max size of output")
|
||||
flag.StringVar(&host, "h", initializers.GetEnv("HOST", "127.0.0.1"), "http host")
|
||||
flag.UintVar(&port, "p", initializers.GetEnvUint("PORT", 7123), "http port")
|
||||
flag.Parse()
|
||||
|
||||
if connStr == "." {
|
||||
connStr, err = filepath.Abs(".state/state.gdbm")
|
||||
if connStr == ".state" {
|
||||
connStr, err = filepath.Abs(connStr)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "auto connstr generate error: %v", err)
|
||||
os.Exit(1)
|
||||
|
@ -47,15 +47,15 @@ func main() {
|
||||
var err error
|
||||
|
||||
flag.StringVar(&resourceDir, "resourcedir", path.Join("services", "registration"), "resource dir")
|
||||
flag.StringVar(&connStr, "c", ".", "connection string")
|
||||
flag.StringVar(&connStr, "c", ".state", "connection string")
|
||||
flag.BoolVar(&engineDebug, "d", false, "use engine debug output")
|
||||
flag.UintVar(&size, "s", 160, "max size of output")
|
||||
flag.StringVar(&host, "h", initializers.GetEnv("HOST", "127.0.0.1"), "http host")
|
||||
flag.UintVar(&port, "p", initializers.GetEnvUint("PORT", 7123), "http port")
|
||||
flag.Parse()
|
||||
|
||||
if connStr == "." {
|
||||
connStr, err = filepath.Abs(".state/state.gdbm")
|
||||
if connStr == ".state" {
|
||||
connStr, err = filepath.Abs(connStr)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "auto connstr generate error: %v", err)
|
||||
os.Exit(1)
|
||||
|
@ -39,13 +39,13 @@ func main() {
|
||||
var err error
|
||||
|
||||
flag.StringVar(&sessionId, "session-id", "075xx2123", "session id")
|
||||
flag.StringVar(&connStr, "c", ".", "connection string")
|
||||
flag.StringVar(&connStr, "c", ".state", "connection string")
|
||||
flag.BoolVar(&engineDebug, "d", false, "use engine debug output")
|
||||
flag.UintVar(&size, "s", 160, "max size of output")
|
||||
flag.Parse()
|
||||
|
||||
if connStr == "." {
|
||||
connStr, err = filepath.Abs(".state/state.gdbm")
|
||||
if connStr == ".state" {
|
||||
connStr, err = filepath.Abs(connStr)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "auto connstr generate error: %v", err)
|
||||
os.Exit(1)
|
||||
|
@ -40,9 +40,6 @@ func probeGdbm(s string) (string, bool) {
|
||||
if !path.IsAbs(s) {
|
||||
return "", false
|
||||
}
|
||||
if path.Ext(s) != ".gdbm" {
|
||||
return "", false
|
||||
}
|
||||
s = path.Clean(s)
|
||||
return s, true
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ type StorageService interface {
|
||||
}
|
||||
|
||||
type MenuStorageService struct {
|
||||
//dbDir string
|
||||
conn connData
|
||||
resourceDir string
|
||||
resourceStore db.Db
|
||||
|
Loading…
Reference in New Issue
Block a user