nats-rpc/nrpc ? reverse-engineered prompt
Reverse engineered prompt
Build me a small Go library that works like gRPC but sends requests over NATS.
I want to define services in a .proto file, then generate Go code for a typed client, a server interface, and a NATS message handler from it. Please include a simple hello world example with a server and a client so I can see the whole flow end to end. The server should connect to NATS, register a handler, and respond to a request, and the client should connect to NATS and call the service like a normal Go method. It would be great if the generated code follows the service and method names from the proto file and uses protobuf messages for the request and reply types.
If you need to check current protobuf or NATS docs while wiring it up, go ahead. Keep it working with plain Go tooling so I can generate the code and run the examples easily.
Are you gonna build this?
make sure you review the code using coderabbit