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

@@ -28,6 +28,8 @@ type ZRpcContext struct {
Output string
// Multiple is the flag to indicate whether the proto file is generated in multiple mode.
Multiple bool
// Whether to generate rpc client
IsGenClient bool
}
// Generate generates a rpc service, through the proto file,
@@ -100,7 +102,9 @@ func (g *Generator) Generate(zctx *ZRpcContext) error {
return err
}
err = g.GenCall(dirCtx, proto, g.cfg, zctx)
if zctx.IsGenClient {
err = g.GenCall(dirCtx, proto, g.cfg, zctx)
}
console.NewColorConsole().MarkDone()