You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Open-IM-Server/pkg/common/cmd/rpc.go

30 lines
676 B

2 years ago
package cmd
import (
2 years ago
"OpenIM/internal/startrpc"
2 years ago
"OpenIM/pkg/discoveryregistry"
"github.com/spf13/cobra"
"google.golang.org/grpc"
)
2 years ago
type AuthCmd struct {
2 years ago
*RootCmd
}
2 years ago
func NewAuthCmd() *AuthCmd {
authCmd := &AuthCmd{NewRootCmd()}
return authCmd
2 years ago
}
2 years ago
func (a *AuthCmd) Execute() error {
a.Command.Run = func(cmd *cobra.Command, args []string) {
2 years ago
//a.port = a.getPortFlag(cmd)
//a.prometheusPort = a.getPrometheusPortFlag(cmd)
2 years ago
}
2 years ago
return a.Execute()
2 years ago
}
2 years ago
2 years ago
func (a *AuthCmd) StartSvr(name string, rpcFn func(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error) error {
return startrpc.Start(a.GetPortFlag(), name, a.GetPrometheusPortFlag(), rpcFn)
2 years ago
}