mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-10 03:56:00 +08:00
cobra
This commit is contained in:
+10
-7
@@ -1,16 +1,19 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"OpenIM/internal/rpc/group"
|
||||
"OpenIM/internal/startrpc"
|
||||
"OpenIM/internal/rpc/friend"
|
||||
"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.OpenImGroupPort[0], config.Config.RpcRegisterName.OpenImGroupName, config.Config.Prometheus.GroupPrometheusPort[0], group.Start); err != nil {
|
||||
panic(err.Error())
|
||||
rpcCmd := cmd.NewRpcCmd(config.Config.RpcRegisterName.OpenImGroupName)
|
||||
rpcCmd.AddPortFlag()
|
||||
rpcCmd.AddPrometheusPortFlag()
|
||||
if err := rpcCmd.Exec(friend.Start); err != nil {
|
||||
fmt.Println(err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user