Go GRPC server
Sample of GRPC server written on go
Setup protobuf
You can skip this section if you do not want to
change existing protobuf
- Install protobuf on your system
- Install
protoc-gen-go-grpc
for go go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
. This is used
to generate client/server code for golang
Generate client, server golang code with command:
protoc --go_out=./gen --go_opt=paths=source_relative --go-grpc_out=./gen --go-grpc_opt=paths=source_relative ./proto/my_service.proto
Setup project
You have to install go and sqlite3
Clone the project and install go packages
git clone https://github.com/Nikita-Filonov/sample_go_grpc_server`
cd ./sample_go_grpc_server
go mod download
Apply migrations
go install github.com/rubenv/sql-migrate/...@latest
sql-migrate up -config=./infrastructure/config.yml
Finally run the server
go mod download