mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-05 01:25:58 +08:00
script
This commit is contained in:
@@ -7,24 +7,23 @@ import (
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type AuthCmd struct {
|
||||
type RpcCmd struct {
|
||||
*RootCmd
|
||||
}
|
||||
|
||||
func NewAuthCmd() *AuthCmd {
|
||||
authCmd := &AuthCmd{NewRootCmd()}
|
||||
func NewRpcCmd() *RpcCmd {
|
||||
authCmd := &RpcCmd{NewRootCmd()}
|
||||
return authCmd
|
||||
}
|
||||
|
||||
func (a *AuthCmd) Exec() error {
|
||||
a.Command.RunE = func(cmd *cobra.Command, args []string) error {
|
||||
func (a *RpcCmd) Exec() error {
|
||||
a.Command.Run = func(cmd *cobra.Command, args []string) {
|
||||
a.port = a.getPortFlag(cmd)
|
||||
a.prometheusPort = a.getPrometheusPortFlag(cmd)
|
||||
return a.getConfFromCmdAndInit(cmd)
|
||||
}
|
||||
return a.Execute()
|
||||
}
|
||||
|
||||
func (a *AuthCmd) StartSvr(name string, rpcFn func(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error) error {
|
||||
func (a *RpcCmd) StartSvr(name string, rpcFn func(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error) error {
|
||||
return startrpc.Start(a.GetPortFlag(), name, a.GetPrometheusPortFlag(), rpcFn)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user