gRPCサーバーの起動
go run ./cmd/server/main.go
または
make run
curlを使用したHttpリクエスト
curl \
--header "Content-Type: application/json" \
--data '{"sentence": "Hello"}' \
http://localhost:8080/chat.v1.ChatService/Say
grpcurlを使用したリクエスト
grpcurl \
-protoset <(buf build -o -) -plaintext \
-d '{"sentence": "Hello"}' \
localhost:8080 chat.v1.ChatService/Say
(grpcurlのインストール)
go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest