Update executables with new conn str

This commit is contained in:
lash 2025-01-04 13:19:30 +00:00
parent dc61d05584
commit 2992f7ae8e
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
6 changed files with 13 additions and 16 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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
}

View File

@ -28,7 +28,6 @@ type StorageService interface {
}
type MenuStorageService struct {
//dbDir string
conn connData
resourceDir string
resourceStore db.Db