quickly generating rpc demo service (#60)

* add execute files

* add protoc-osx

* add rpc generation

* add rpc generation

* add: rpc template generation

* add README.md

* format error

* reactor templatex.go

* update project.go & README.md

* add: quickly generate rpc service
This commit is contained in:
Keson
2020-09-11 15:26:55 +08:00
committed by GitHub
parent 0d151c17f8
commit 17e6cfb7a9
10 changed files with 277 additions and 100 deletions

View File

@@ -4,6 +4,8 @@ import (
"fmt"
"os"
"github.com/urfave/cli"
"github.com/tal-tech/go-zero/core/logx"
"github.com/tal-tech/go-zero/tools/goctl/api/apigen"
"github.com/tal-tech/go-zero/tools/goctl/api/dartgen"
@@ -19,7 +21,6 @@ import (
"github.com/tal-tech/go-zero/tools/goctl/feature"
model "github.com/tal-tech/go-zero/tools/goctl/model/sql/command"
rpc "github.com/tal-tech/go-zero/tools/goctl/rpc/command"
"github.com/urfave/cli"
)
var (
@@ -193,6 +194,17 @@ var (
Name: "rpc",
Usage: "generate rpc code",
Subcommands: []cli.Command{
{
Name: "new",
Usage: `generate rpc demo service`,
Flags: []cli.Flag{
cli.BoolFlag{
Name: "idea",
Usage: "whether the command execution environment is from idea plugin. [option]",
},
},
Action: rpc.RpcNew,
},
{
Name: "template",
Usage: `generate proto template`,
@@ -224,10 +236,6 @@ var (
Name: "service, srv",
Usage: `the name of rpc service. [option]`,
},
cli.StringFlag{
Name: "shared",
Usage: `the dir of the shared file,default path is "${pwd}/shared. [option]`,
},
cli.BoolFlag{
Name: "idea",
Usage: "whether the command execution environment is from idea plugin. [option]",