change name, add comment

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-06-22 01:34:06 +03:00
parent c6caa0d3ac
commit 81bbbf55e6
9 changed files with 15 additions and 9 deletions

View File

@ -1,4 +1,4 @@
# `protoc-gen-micro`
# `protoc-gen-go-micro`
protobuf plugin to generate helper code for micro framework
A generic **code**/script/data generator based on [Protobuf](https://developers.google.com/protocol-buffers/).
@ -23,4 +23,4 @@ $> protoc --micro_out=debug=true,components="micro|http":. input.proto
* Install the **go** compiler and tools from https://golang.org/doc/install
* Install **protoc-gen-go**: `go get google.golang.org/protobuf/cmd/protoc-gen-go`
* Install **protoc-gen-micro**: `go get github.com/unistack-org/protoc-gen-micro/v3`
* Install **protoc-gen-go-micro**: `go get github.com/unistack-org/protoc-gen-go-micro/v3`

3
chi.go
View File

@ -30,7 +30,8 @@ func (g *Generator) chiGenerate(component string, plugin *protogen.Plugin) error
}
gfile := plugin.NewGeneratedFile(gname, path)
gfile.P("// Code generated by protoc-gen-micro")
gfile.P("// Code generated by protoc-gen-go-micro. DO NOT EDIT.")
gfile.P("// protoc-gen-go-micro version: " + versionComment)
gfile.P("package ", file.GoPackageName)
gfile.P()

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package example;
option go_package = "github.com/unistack-org/protoc-gen-micro/v3/example;examplepb";
option go_package = "github.com/unistack-org/protoc-gen-go-micro/v3/example;examplepb";
import "tag/tag.proto";
import "api/annotations.proto";

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/unistack-org/protoc-gen-micro/v3
module github.com/unistack-org/protoc-gen-go-micro/v3
go 1.16

View File

@ -30,7 +30,8 @@ func (g *Generator) gorillaGenerate(component string, plugin *protogen.Plugin) e
}
gfile := plugin.NewGeneratedFile(gname, path)
gfile.P("// Code generated by protoc-gen-micro")
gfile.P("// Code generated by protoc-gen-go-micro. DO NOT EDIT.")
gfile.P("// protoc-gen-go-micro version: " + versionComment)
gfile.P("package ", file.GoPackageName)
gfile.P()

View File

@ -20,7 +20,8 @@ func (g *Generator) httpGenerate(component string, plugin *protogen.Plugin, genC
}
gfile := plugin.NewGeneratedFile(gname, path)
gfile.P("// Code generated by protoc-gen-micro")
gfile.P("// Code generated by protoc-gen-go-micro. DO NOT EDIT.")
gfile.P("// protoc-gen-go-micro version: " + versionComment)
gfile.P("// source: ", file.Proto.GetName())
gfile.P("package ", file.GoPackageName)
gfile.P()

View File

@ -21,7 +21,8 @@ func (g *Generator) microGenerate(component string, plugin *protogen.Plugin, gen
}
gfile := plugin.NewGeneratedFile(gname, path)
gfile.P("// Code generated by protoc-gen-micro")
gfile.P("// Code generated by protoc-gen-go-micro. DO NOT EDIT.")
gfile.P("// protoc-gen-go-micro version: " + versionComment)
gfile.P("// source: ", file.Proto.GetName())
gfile.P("package ", file.GoPackageName)
gfile.P()

3
rpc.go
View File

@ -20,7 +20,8 @@ func (g *Generator) rpcGenerate(component string, plugin *protogen.Plugin, genCl
}
gfile := plugin.NewGeneratedFile(gname, path)
gfile.P("// Code generated by protoc-gen-micro")
gfile.P("// Code generated by protoc-gen-go-micro. DO NOT EDIT.")
gfile.P("// protoc-gen-go-micro version: " + versionComment)
gfile.P("// source: ", file.Proto.GetName())
gfile.P("package ", file.GoPackageName)
gfile.P()

View File

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