consul-go-grpc-demo icon indicating copy to clipboard operation
consul-go-grpc-demo copied to clipboard

用consul做grpc的服务注册与发现,示例代码

consul-go-grpc-demo

用consul做grpc的服务注册与发现,示例代码

requires:

go 1.12

run

  • run consul
consul agent -dev
  • server
cd server
go mod tidy
go run cmd/main.go
  • client
cd client
go mod tidy
go run cmd/main.go