1234567891011121314151617181920212223242526272829303132 |
- /*
- Copyright © 2022 NAME HERE <EMAIL ADDRESS>
- */
- package cmd
- import (
- "kpt-grpc-demo/config"
- "kpt-grpc-demo/dep"
- "kpt-grpc-demo/util/svcutil"
- "github.com/spf13/cobra"
- )
- // grpcCmd represents the grpc command
- var grpcCmd = &cobra.Command{
- Use: "grpc",
- Short: "start grpc server",
- Run: func(cmd *cobra.Command, args []string) {
- svcutil.StandBy(config.Options().HTTPServerAddr, func() {
- server := dep.DIGRPCServer()
- defer func() {
- _ = server.Close()
- }()
- server.Run()
- })
- },
- }
- func init() {
- }
|