I include detailed information as this is something I struggled with when I first encountered protocol buffers!
Within the root directory i.e. gprc-auth-mongo
# Generate the Proto file alone
$ protoc --go_out=. proto/services.proto
# Generate the GRPC file
$ protoc --go_out=. --go-grpc_out=. proto/services.proto
Within the .proto
file itself, we set the package and optional go_package
// services.proto
option go_package = "./proto" // ignore the error
package proto
$ go run server/main.go
$ go run client/main.go
The client will output two JWT tokens [AuthResponse]
- for when the User registers
- for when the User logs in.