add whether to generate rpc client option (#3361)

Co-authored-by: admin <admin@admindeMacBook-Pro.local>
This commit is contained in:
Mikael
2023-06-17 20:52:49 +08:00
committed by GitHub
parent b176d5d434
commit f5f5261556
7 changed files with 25 additions and 16 deletions

View File

@@ -44,6 +44,8 @@ var (
VarBoolVerbose bool
// VarBoolMultiple describes whether support generating multiple rpc services or not.
VarBoolMultiple bool
// VarBoolClient describes whether to generate rpc client
VarBoolClient bool
)
// RPCNew is to generate rpc greet service, this greet service can speed
@@ -88,6 +90,7 @@ func RPCNew(_ *cobra.Command, args []string) error {
ctx.IsGooglePlugin = true
ctx.Output = filepath.Dir(src)
ctx.ProtocCmd = fmt.Sprintf("protoc -I=%s %s --go_out=%s --go-grpc_out=%s", filepath.Dir(src), filepath.Base(src), filepath.Dir(src), filepath.Dir(src))
ctx.IsGenClient = VarBoolClient
grpcOptList := VarStringSliceGoGRPCOpt
if len(grpcOptList) > 0 {