1. grpc gateway 安装 参考,比较简单,有需要的依赖可以参考相资料 mkdir tmp cd tmp git clone https://github.com/google/protobuf cd protobuf ./autogen.sh ./configure make make check sudo make install go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway go
本文介绍一些主要的gRPC概念. 服务定义 gRPC支持4种方法: 1.Unary RPCs where the client sends a single request to the server and gets a single response back, just like a normal function call. 入参和返回值是一个普通的protocol buffer message.示例: message HelloRequest { string greeting = 1
一.安装 go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger go get -u github.com/golang/protobuf/protoc-gen-go 二.proto 文件 syntax = "proto3"; package gateway; i