@nareshbhatia/grpc-pet-server
v0.0.1
Published
A simple Go server to demonstrate gRPC concepts
Readme
gRPC Pet Server
A simple Go server to demonstrate gRPC concepts
Development
Prerequisites
- Buf CLI
- Go 1.21 or later (for Go code generation)
- Node.js 20 or later (for TypeScript code generation and npm publishing)
Linting
buf lintCode Generation for Go
buf generate --template buf.gen.go.yamlCode Generation for TypeScript
buf generate --template buf.gen.ts.yamlStarting the server
go mod tidy
go run server/main.goCalling GetStatus
buf curl \
--schema . \
http://localhost:8080/pet.v1.PetService/GetStatus
# Random response:
# {
# "status": "PET_STATUS_TRAINING"
# }Calling SubscribeHeartbeat
buf curl \
--schema . \
http://localhost:8080/pet.v1.PetService/SubscribeHeartbeat
# Response:
# {
# "timestampMs": "1766547064733"
# }
# {
# "timestampMs": "1766547065733"
# }
# ...