|
|
@ -7,10 +7,15 @@ import ( |
|
|
|
"path" |
|
|
|
"path" |
|
|
|
"strings" |
|
|
|
"strings" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"golang.org/x/text/cases" |
|
|
|
|
|
|
|
"golang.org/x/text/language" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/emicklei/proto" |
|
|
|
"github.com/emicklei/proto" |
|
|
|
"github.com/spf13/cobra" |
|
|
|
"github.com/spf13/cobra" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var caser = cases.Title(language.English) |
|
|
|
|
|
|
|
|
|
|
|
// CmdServer the service command.
|
|
|
|
// CmdServer the service command.
|
|
|
|
var CmdServer = &cobra.Command{ |
|
|
|
var CmdServer = &cobra.Command{ |
|
|
|
Use: "server", |
|
|
|
Use: "server", |
|
|
@ -60,7 +65,7 @@ func run(cmd *cobra.Command, args []string) { |
|
|
|
r, ok := e.(*proto.RPC) |
|
|
|
r, ok := e.(*proto.RPC) |
|
|
|
if ok { |
|
|
|
if ok { |
|
|
|
cs.Methods = append(cs.Methods, &Method{ |
|
|
|
cs.Methods = append(cs.Methods, &Method{ |
|
|
|
Service: s.Name, Name: r.Name, Request: r.RequestType, |
|
|
|
Service: s.Name, Name: caser.String(r.Name), Request: r.RequestType, |
|
|
|
Reply: r.ReturnsType, Type: getMethodType(r.StreamsRequest, r.StreamsReturns), |
|
|
|
Reply: r.ReturnsType, Type: getMethodType(r.StreamsRequest, r.StreamsReturns), |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|