major change of websocket dbmHandler structure
This commit is contained in:
36
args/args.go
Normal file
36
args/args.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user