Skip to content

JasonJiangs/Microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Golang-Microservice

The project implements several small scripts and microservices using Golang and its multiple frameworks.

There are several technologies used:

  1. Remote Procedure Call Protocol (RPC)
  2. gRPC
  3. Protocol Buffers
  4. go-micro
  5. Consul
  6. Gin
  7. Redis
  8. Alibaba Cloud
  9. GORM
  10. MySQL
  11. FastDFS
  12. Nginx

Practice 1: Chatting Room

Path: src/Chatting Room

This project implements a chatting room mainly using channel and net library to realize the communication between multiple clients and server.

Practice 2: RPCapi

Path: src/RPCapi

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.

Practice 3: gRPC

Path: src/gRPC

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/protoc-gen-go@v1.28
$ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
$ export PATH="$PATH:$(go env GOPATH)/bin"

Releases

No releases published

Packages

No packages published

Languages