mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-06 01:55:58 +08:00
cobra
This commit is contained in:
+9
-6
@@ -2,15 +2,18 @@ package main
|
||||
|
||||
import (
|
||||
"OpenIM/internal/rpc/msg"
|
||||
"OpenIM/internal/startrpc"
|
||||
"OpenIM/pkg/common/cmd"
|
||||
"OpenIM/pkg/common/config"
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
if err := config.InitConfig(""); err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
if err := startrpc.Start(config.Config.RpcPort.OpenImMessagePort[0], config.Config.RpcRegisterName.OpenImMsgName, config.Config.Prometheus.AuthPrometheusPort[0], msg.Start); err != nil {
|
||||
panic(err.Error())
|
||||
rpcCmd := cmd.NewRpcCmd(config.Config.RpcRegisterName.OpenImMsgName)
|
||||
rpcCmd.AddPortFlag()
|
||||
rpcCmd.AddPrometheusPortFlag()
|
||||
if err := rpcCmd.Exec(msg.Start); err != nil {
|
||||
fmt.Println(err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user