Hi,
I am busy with a side project to learn more about the GRPC ecosystem. I
want to check if I am headed down the right path when it comes to vendor
proto/gen-proto.
Current Project Setup.
- Mono Repo for proto definitions
- The build automatically builds proto definitions and push them to a
remote repo. Example -
https://github.com/brettmostert/trple-proto-product-go
- Implementation Project (server and client)
- Uses the lib/module from
https://github.com/brettmostert/trple-proto-product-go
- Repo of Implementation https://github.com/brettmostert/trple
So from what I can tell the above is a common setup for sharing "internal"
proto definitions and compiled/generated proto libs.
The real question is when using a "vendor"'s proto definitions Example
https://github.com/googleapis/go-genproto/tree/main/googleapis/type
I believe the setup would be to
1. Clone the proto definition repo and import the proto files I need in
my proto project i.e. money.proto. So that my proto's can reference the
vendor ones.
2. Clone the proto generated repo and replace the vendors module URL
with my forked version using `go mod edit -replace=
"google.golang.org/genproto=github.com/brettmostert/go-genproto@3a66f56"
`
So in summary...
- Create your OWN proto repo
- FORK any proto repo you want to use
- Generate the code for the FORKED Repo
- Generate the code for the your OWN
- which is dependant on the generated code from the FORKED REPO
- so replace the original module url with your forked version (go)
- Import your OWN generated module in the implementation project
Thanks in advance... The repo's linked for triple are work in progress
until I get all the scaffolding done. I do know about buf.build, its really
nice, but I want to get it working without the buf.build registry and once
I understand it, I may move onto some nice tooling like their registry.
Thanks,
Brett
--
You received this message because you are subscribed to the Google Groups
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/grpc-io/dfe89084-8165-4359-8866-0e2158017902n%40googlegroups.com.