The project implements several small scripts and microservices using Golang and its multiple frameworks.
There are several technologies used:
- Remote Procedure Call Protocol (RPC)
- gRPC
- Protocol Buffers
- go-micro
- Consul
- Gin
- Redis
- Alibaba Cloud
- GORM
- MySQL
- FastDFS
- Nginx
This project implements a chatting room mainly using channel and net library to realize the communication between multiple clients and server.
RPC is a remote procedure call protocol. It is a communication protocol between two computers on a network. The project implements a simple RPC server and client, and simply encapsulates the function of server and client.
Want to use protobuf, we need to use gRPC as a whole package.
Compile protobuf file:
go install github.com/golang/protobuf/protoc-gen-go@latest
protoc --go_out=./ *.proto
# grpc compile instead of protoc
protoc --go_out=plugins=grpc:./ *.proto
Install gRPC:
$ go install google.golang.org/protobuf/cmd/[email protected]
$ go install google.golang.org/grpc/cmd/[email protected]
$ export PATH="$PATH:$(go env GOPATH)/bin"