As you can see on the picture, the
monoplay folder is the root.
pb folder contains the generated
gRPC code that I would like to consume in the
The question is, how to consume the generated
gRPC code from folder
pb in the
Is the folder structure correct?
Would like also to deploy the services individually.
Is maybe https://bazel.build/ the solution?
Having the entire repository as one go module will help with this, i.e only one go.mod file in the "Monoplay" root folder.
Then the services can reference the generated go files using "github.com/*/monoplay/pb/*" imports.
This will also centralize dependency management for all the entire repository, since there is only one go.mod file, if that is something you want.
Using "go mod edit":
Or, as DazWilkin suggests, use "go_package" in proto files together with "go-grpc_opt" and "go_opt".
I use the single module approach and recommend it.
If the repository will contain a lot of code and building everything (including container images) is cumbersome and takes to long then look into bazel.
Answered By – fratle
Answer Checked By – David Goodson (GoLangFix Volunteer)