generate error types for http

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-02-23 14:30:23 +03:00
parent e18a0f6942
commit a974da658b
7 changed files with 93 additions and 48 deletions

3
rpc.go
View File

@@ -13,7 +13,7 @@ func (g *Generator) rpcGenerate(component string, plugin *protogen.Plugin) error
continue
}
gname := file.GeneratedFilenamePrefix + "_" + component + ".pb.go"
gname := file.GeneratedFilenamePrefix + "_micro_" + component + ".pb.go"
gfile := plugin.NewGeneratedFile(gname, ".")
gfile.P("// Code generated by protoc-gen-micro")
@@ -23,6 +23,7 @@ func (g *Generator) rpcGenerate(component string, plugin *protogen.Plugin) error
gfile.P()
gfile.P("import (")
gfile.P(`"context"`)
gfile.P()
gfile.P(`micro_api "github.com/unistack-org/micro/v3/api"`)
gfile.P(`micro_client "github.com/unistack-org/micro/v3/client"`)
gfile.P(`micro_server "github.com/unistack-org/micro/v3/server"`)