add ServiceName variable

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-07-14 13:49:37 +03:00
parent dd872a03b3
commit b4231422b3
2 changed files with 3 additions and 1 deletions

View File

@ -449,6 +449,8 @@ func generateServiceServerStreamInterface(gfile *protogen.GeneratedFile, service
func generateServiceEndpoints(gfile *protogen.GeneratedFile, service *protogen.Service) { func generateServiceEndpoints(gfile *protogen.GeneratedFile, service *protogen.Service) {
serviceName := service.GoName serviceName := service.GoName
gfile.P("var (") gfile.P("var (")
gfile.P(serviceName, "Name", "=", `"`, serviceName, `"`)
gfile.P()
gfile.P(serviceName, "Endpoints", "=", "[]", microApiPackage.Ident("Endpoint"), "{") gfile.P(serviceName, "Endpoints", "=", "[]", microApiPackage.Ident("Endpoint"), "{")
for _, method := range service.Methods { for _, method := range service.Methods {
if method.Desc.Options() == nil { if method.Desc.Options() == nil {

View File

@ -17,5 +17,5 @@ var (
microClientHttpPackage = protogen.GoImportPath("github.com/unistack-org/micro-client-http/v3") microClientHttpPackage = protogen.GoImportPath("github.com/unistack-org/micro-client-http/v3")
timePackage = protogen.GoImportPath("time") timePackage = protogen.GoImportPath("time")
deprecationComment = "// Deprecated: Do not use." deprecationComment = "// Deprecated: Do not use."
versionComment = "v3.4.1" versionComment = "v3.4.2"
) )