Go 🤝 gRPC
This directory contains gRPC definitions.
The cmd/ directory contains the main applications of the project. In this case, there are client and server directories.
The config/ directory holds configuration files such as environment or settings.
The model/ directory contains database entities.
The store/ directory contains sql logic for models. Eg: user store logics like queryProfile, editProfile. And it's related user model.
The module/ directory is collections of domain logic or features.
The pkg/ directory typically houses reusable packages or libraries that can be used across the project or potentially shared with other projects.
This directory contains Protobuf files, which are used for defining gRPC services and messages.
The sql/ directory contains SQL scripts, particularly release notes related to database schema changes or updates.
brew install protobuf
protoc --version
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
export PATH="$PATH:$(go env GOPATH)/bin"
go mod tidy
go mod vendor
docker run -it --name database -p 3306:3306 -e MYSQL_ROOT_PASSWORD=cuongpo -e MYSQL_DATABASE=cuongpo mysql:latest
protoc --proto_path=proto \
--go_out=api --go_opt=paths=source_relative \
--go-grpc_out=api --go-grpc_opt=paths=source_relative,require_unimplemented_servers=false \
proto/*.proto
cd cmd/server && go run main.go
cd cmd/client && go run main.go
MIT © Cuong Nguyen 2024