Files
open-im-server/pkg/common/cmd/push.go
T

23 lines
462 B
Go
Raw Normal View History

2023-03-08 13:34:12 +08:00
package cmd
import (
"OpenIM/internal/push"
"OpenIM/internal/startrpc"
"OpenIM/pkg/common/config"
"github.com/spf13/cobra"
)
type PushCmd struct {
2023-03-09 13:28:39 +08:00
*AuthCmd
2023-03-08 13:34:12 +08:00
}
func NewPushCmd() *PushCmd {
2023-03-09 13:28:39 +08:00
return &PushCmd{NewAuthCmd()}
2023-03-08 13:34:12 +08:00
}
2023-03-09 13:28:39 +08:00
func (r *PushCmd) AddPush() {
2023-03-08 13:34:12 +08:00
r.Command.RunE = func(cmd *cobra.Command, args []string) error {
2023-03-09 12:48:21 +08:00
return startrpc.Start(r.getPortFlag(cmd), config.Config.RpcRegisterName.OpenImPushName, r.getPrometheusPortFlag(cmd), push.Start)
2023-03-08 13:34:12 +08:00
}
}