major change of websocket dbmHandler structure

This commit is contained in:
Adrian Zürcher
2025-04-23 21:53:01 +02:00
parent a1f947e24a
commit 0a137c9d86
35 changed files with 1676 additions and 424 deletions

36
args/args.go Normal file
View File

@@ -0,0 +1,36 @@
package args
import (
"flag"
"github.com/zuadi/tecamino-dbm/cert"
"github.com/zuadi/tecamino-dbm/models"
)
type Args struct {
Port models.Port
Cert cert.Cert
RootDir string
DMAFile string
Debug bool
}
func Init() *Args {
a := Args{
Cert: cert.Cert{
Organization: *flag.String("org", "tecamino", "name of organization for certificate"),
CertFile: *flag.String("certFile", "./cert/cert.pem", "path of certfile"),
KeyFile: *flag.String("keyFile", "./cert/key.pem", "path of keyfile"),
},
Port: models.Port{
Http: *flag.Uint("http-port", 8100, "json server communication for http/ws"),
Https: *flag.Uint("https-port", 8101, "json server communication for http/wss"),
},
RootDir: *flag.String("workingDir", "./", "working directory"),
DMAFile: *flag.String("dma", "/test/test", "dma file name"),
Debug: *flag.Bool("debug", false, "debug flag"),
}
flag.Parse()
return &a
}