This is grpc server for golang.
brew install protoc
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1
protoc --go_out=. --go-grpc_out=require_unimplemented_servers=false:. ./proto/todo.proto
brew tap grpc/grpc
brew install grpc
docker-compose up
command
grpc_cli ls localhost:50051
response
grpc.reflection.v1alpha.ServerReflection
todo_app.ToDoService
command
grpc_cli ls localhost:50051 todo_app.ToDoService -l
response
filename: proto/todo.proto
package: todo_app;
service ToDoService {
rpc CreateTask(todo_app.CreateTaskRequest) returns (todo_app.CreateTaskResponse) {}
rpc ShowList(todo_app.ShowListRequest) returns (todo_app.ShowListResponse) {}
}
command
grpc_cli call localhost:50051 todo_app.ToDoService.CreateTask 'title: "HELLO"'
response
connecting to localhost:50051
title: "HELLO"
create_time {
seconds: 1641139300
nanos: 49475000
}
go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc
protoc --doc_out=html,index.html:./doc proto/*.proto