The project that using golang 1.19. For learning about grpc.
-
For install dependencies: go mod tidy
-
For generate proto files (protocol buffer and grpc):
protoc --go_out=. --go-grpc_out=. proto/course_category.proto
-
For install gRPC dependencies: go mod tidy
-
You need install evans gRPC for calls: https://github.com/ktr0731/evans#installation
-
create database and table:
touch db.sqlite
sqlite3 db.sqlite
create table categories (id string, name string, description string);
-
Start application: go run cmd/grpcServer/main.go
-
Started evans services: evans -r repl OBS: You can use the binary file and started service directly it. For example (linux): ./evans -r repl
-
After started evans. You can test call to grpc services with call name-of-service. For example: call ListCategories