Compare commits

...

2 Commits

Author SHA1 Message Date
f69088bd27 fallback to generate client and server
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-03-30 18:30:58 +03:00
be4eac21df fix example
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-03-26 16:04:08 +03:00

View File

@@ -12,7 +12,7 @@ import (
var ( var (
flagDebug = flag.Bool("debug", false, "") flagDebug = flag.Bool("debug", false, "")
flagStandalone = flag.Bool("standalone", false, "") flagStandalone = flag.Bool("standalone", false, "")
flagComponents = flag.String("components", "micro|rpc|client|server", "") flagComponents = flag.String("components", "micro|rpc|http|client|server", "")
) )
func main() { func main() {
@@ -48,6 +48,12 @@ func (g *Generator) Generate(plugin *protogen.Plugin) error {
if strings.Contains(g.components, "client") { if strings.Contains(g.components, "client") {
genClient = true genClient = true
} }
if strings.Contains(g.components, "rpc") || strings.Contains(g.components, "http") {
if !genServer && !genClient {
genServer = true
genClient = true
}
}
// Protoc passes a slice of File structs for us to process // Protoc passes a slice of File structs for us to process
for _, component := range strings.Split(g.components, "|") { for _, component := range strings.Split(g.components, "|") {