This commit is contained in:
wangchuxiao
2023-03-08 13:34:12 +08:00
parent 107f4c950b
commit f8ad35a6f7
24 changed files with 209 additions and 125 deletions
+22
View File
@@ -0,0 +1,22 @@
package cmd
import (
"OpenIM/internal/push"
"OpenIM/internal/startrpc"
"OpenIM/pkg/common/config"
"github.com/spf13/cobra"
)
type PushCmd struct {
*RpcCmd
}
func NewPushCmd() *PushCmd {
return &PushCmd{NewRpcCmd(config.Config.RpcRegisterName.OpenImPushName)}
}
func (r *RpcCmd) AddPush() {
r.Command.RunE = func(cmd *cobra.Command, args []string) error {
return startrpc.Start(r.getPortFlag(cmd), r.rpcRegisterName, r.getPrometheusPortFlag(cmd), push.Start)
}
}