37 lines
939 B
Go
37 lines
939 B
Go
package args
|
|
|
|
import (
|
|
"flag"
|
|
|
|
"github.com/tecamino/tecamino-dbm/cert"
|
|
"github.com/tecamino/tecamino-dbm/models"
|
|
)
|
|
|
|
type Args struct {
|
|
Port models.Port
|
|
Cert cert.Cert
|
|
RootDir string
|
|
DBMFile 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"),
|
|
DBMFile: *flag.String("dbm", "/test/test", "dbm file name"),
|
|
Debug: *flag.Bool("debug", false, "debug flag"),
|
|
}
|
|
flag.Parse()
|
|
return &a
|
|
}
|