gRPC Awesome
约 4 分钟阅读
标签:资源精选
- grpc-ecosystem/grpc-gatewayGitHubgrpc-ecosystem/grpc-gateway
- gRPC -> OpenAPIv2
- sudorandom/protoc-gen-connect-openapiGitHubsudorandom/protoc-gen-connect-openapi
- 从 protobuf/Connect RPC 接口生成 OpenAPI v3 的插件。
- grpc-ecosystem/grpc-gateway#441GitHub Issuegrpc-ecosystem/grpc-gateway#441
- OpenAPIv3
- grpc-ecosystem/protoc-gen-grpc-gateway-tsGitHubgrpc-ecosystem/protoc-gen-grpc-gateway-ts
- Apache-2.0, Golang
- google/gnosticGitHubgoogle/gnostic
- OpenAPI <-> gRPC
- 支持 OpenAPIv3
- grpc/grpc-webGitHubgrpc/grpc-webgRPC Web · grpc/grpc-web · nginx · ngxhttpgrpcmodule · Introducing gRPC Support with NGINX 1.13.10 · envoy · improbable-eng/grpc-web笔记:grpc web
- gRPC in Web
- 需要代理
- google/rejoinerGitHubgoogle/rejoiner
- Java
- gRPC -> GraphQL
- ysugimoto/grpc-graphql-gatewayGitHubysugimoto/grpc-graphql-gateway
- grpc-ecosystem/awesome-grpcGitHubgrpc-ecosystem/awesome-grpc
- Web
- bufbuild/protobuf-esGitHubbufbuild/protobuf-esbufbuild/protobuf-es · Apache-2.0, TS · protoc-gen-es · target - 默认为 js+dts · js - 生成 · ts - 生成 · dts - 生成 · importextension - import 的后缀笔记:protobuf-es
- protobuf-ts 相同作者,可能后期工作会更倾向于该项目
- from protobuf-tsGitHub 文件bufbuild/protobuf-es/docs/migrating.md#from-protobuf-ts
- 通过 @bufbuild/protobuf 使用 Well-known types 而不是本地生成的
- 基于 class
- timostamm/protobuf-tsGitHubtimostamm/protobuf-ts
- 依赖 tsc 生成代码
- smithy-lang/smithy-typescriptGitHubsmithy-lang/smithy-typescript
- Smithy 的 TypeScript 代码生成器。
- bufbuild/protobuf-esGitHubbufbuild/protobuf-esbufbuild/protobuf-es · Apache-2.0, TS · protoc-gen-es · target - 默认为 js+dts · js - 生成 · ts - 生成 · dts - 生成 · importextension - import 的后缀笔记:protobuf-es
LB/Gateway/Proxy
- grpc.lb.v1.LoadBalancerGitHub 文件grpc/grpc/src/proto/grpc/lb/v1/load_balancer.proto
- gRPC-aware proxy/Load balance
- liyue201/grpc-lbGitHubliyue201/grpc-lb
- 客户端使用 google.golang.org/grpc/resolver.Register 注册 LB 实现
- gotway/gotwayGitHubgotway/gotway
- mmontes11/go-grpc-routesGitHubmmontes11/go-grpc-routes
- grpc-ecosystem.github.io/grpc-gateway
- go.chromium.org/luci/grpc/discoveryGo 包go.chromium.org/luci/grpc/discoveryGo
- mwitkow/grpc-proxyGitHubmwitkow/grpc-proxygRPC Ecosystem · Third-Party Add-ons for Protocol Buffers · 服务端暂不支持 PHP · 可以跟踪该帖子 Servers in PHP? · google.protobuf · 默认定义笔记:gRPC
- siderolabs/grpc-proxyGitHubsiderolabs/grpc-proxy
- one-to-many proxying and result aggregation.
- etcd grpc-proxy
参考
- wenerme/grpc-protosGitHubwenerme/grpc-protos
- Practical API Design at Netflix, Part 1: Using Protobuf FieldMask
- googleapis/googleapisGitHubgoogleapis/googleapis
- kubernetes/cri-api/pkg/apis/runtime/v1/api.protoGitHub 文件kubernetes/cri-api/pkg/apis/runtime/v1/api.proto
- kubernetes/api/core/v1/generated.protoGitHub 文件kubernetes/api/core/v1/generated.proto
- tensorflow/serving/tensorflow_serving/apisGitHub 文件tensorflow/serving/tensorflow_serving/apis
- asim/go-micro/api/proto/api.protoGitHub 文件asim/go-micro/api/proto/api.proto
- kubeflow/katib/pkg/apisGitHub 文件kubeflow/katib/pkg/apis
- p4lang/p4runtime/proto/p4/v1GitHub 文件p4lang/p4runtime/proto/p4/v1
- onosproject/onos-api/protoGitHub 文件onosproject/onos-api/proto
- thanos-io/thanos/searchGitHubthanos-io/thanos/search
工具
- Kong/insomniaGitHubKong/insomnia
- bloomrpc/bloomrpcGitHubbloomrpc/bloomrpc
- GUI for GRPC
- getezy/ezyGitHubgetezy/ezy
- MPL-2.0, TS
- GUI gRPC/gRPC-Web client
- envoyproxy/protoc-gen-validateGitHubenvoyproxy/protoc-gen-validateenvoyproxy/protoc-gen-validate · 提供校验能力 · 支持 go,java,cc笔记:protoc-gen-validate
- 生成校验规则
- bufbuild/bufGitHubbufbuild/bufbufbuild/buf · BUFCACHEDIR · go-grpc · 关于兼容 ts-proto https://github.com/connectrpc/connect-es/issues/1030 · 注意 @bufbuild/protobuf @bufbuild/protoc-gen-es 需要配合 @connectrpc/connec...笔记:buf
- uber/prototoolGitHububer/prototool
- 工具集 - 不活跃 - 推荐使用 buf
- lint, generate
- improbable-eng/grpc-webGitHubimprobable-eng/grpc-webgRPC Web · grpc/grpc-web · nginx · ngxhttpgrpcmodule · Introducing gRPC Support with NGINX 1.13.10 · envoy · improbable-eng/grpc-web笔记:grpc web
- gRPC Web 实现
- 支持 Websocket 模式
- improbable-eng/ts-protoc-genGitHubimprobable-eng/ts-protoc-gen
- google/gnosticGitHubgoogle/gnostic
- OpenAPI <-> gRPC
- 支持 OpenAPIv3
- googleapis/api-linterGitHubgoogleapis/api-linter
- tmc/grpcutilGitHubtmc/grpcutil
- ktr0731/evansGitHubktr0731/evans
- expressive universal gRPC client
- containerd/ttrpcGitHubcontainerd/ttrpccontainerd/containerd · 参考 · containerd/ttrpc · 通讯协议 · GRPC for low-memory environments · containerd/zfs · zfs snapshotter笔记:containerd
- 轻量 grpc
- 非 grpc 协议
UI
- uw-labs/bloomrpcGitHubuw-labs/bloomrpc
- fullstorydev/grpcurlGitHubfullstorydev/grpcurlfullstorydev/grpcurl笔记:grpcurl
- fullstorydev/grpcuiGitHubfullstorydev/grpcui
- MIT, Go,JS
- web UI for gRPC
- 实现基于 grpcurl
# brew install grpcui
go install github.com/fullstorydev/grpcui/cmd/grpcui@latest
grpcui -plaintext localhost:12345
# 使用 反射 则不需要 proto 信息
grpcui -use-reflection -base-path /api/rpc -plaintext localhost:18080- rogchap/wombatGitHubrogchap/wombat
- warmuuh/milkmanGitHubwarmuuh/milkman
- IntelliJ IDEA v2021.3+ HTTP Client 支持 gRPC
### helloworld
GRPC localhost:8888/helloworld.Greeter/SayHello### health
GRPC localhost:8888/grpc.health.v1.Health/Check- ReflectionGitHub 文件grpc/grpc/doc/server-reflection.md
- grpc.reflection.v1.ServerReflection
- grpc.reflection.v1alpha.ServerReflection
- bufbuild/connect-grpcreflect-goGitHubbufbuild/connect-grpcreflect-go
- grpc.health.v1.Health
Health
- grpc/grpc/doc/health-checking.mdGitHub 文件grpc/grpc/doc/health-checking.md
- grpc-ecosystem/grpc-health-probeGitHubgrpc-ecosystem/grpc-health-probe
- apssouza22/grpc-production-goGitHubapssouza22/grpc-production-go
syntax = "proto3";
package grpc.health.v1;
message HealthCheckRequest {
string service = 1;
}
message HealthCheckResponse {
enum ServingStatus {
UNKNOWN = 0;
SERVING = 1;
NOT_SERVING = 2;
SERVICE_UNKNOWN = 3; // Used only by the Watch method.
}
ServingStatus status = 1;
}
service Health {
rpc Check(HealthCheckRequest) returns (HealthCheckResponse);
rpc Watch(HealthCheckRequest) returns (stream HealthCheckResponse);
}RPC
- smallnest/rpcxGitHubsmallnest/rpcxsmallnest/rpcx · 国产 RPC 框架 · smallnest/rpcx-java · Java 实现,不活跃 · 适用方便 · 设计上没有 go-micro 灵活 · 耦合了很多内容 · 通过 server.AuthFunc 设置认证处理而不是 middleware笔记:rpcx
- 国内项目
- twitchtv/twirpGitHubtwitchtv/twirptwitchtv/twirp · unary RPC · 支持 JSON 协议 · 使用 GRPC 定义,走 HTTP 协议 · 开发不活跃 · 官方支持语言: PHP, Ruby, Go · 参考 · SpecV7 · 不支持 streaming #3笔记:twirp
- 使用 grpc 的服务定义和序列化
gen
- protoc plugins
- protoc-gen-go-grpc
- protoc-gen-grpc
- protoc-gen-grpc-gateway
- protoc-gen-grpc-java
- protoc-gen-grpc-web
- planetscale/vtprotobufGitHubplanetscale/vtprotobuf
- 优化基于 gogo - 使用 APIv2
- 支持 Pool
- 增加一些简单的辅助方法
- planetscale/vtprotobufGitHubplanetscale/vtprotobuf
- protoc-gen-go-drpc
- storj/drpcGitHubstorj/drpc
- 一个更加简单轻量的 RPC 协议
- storj/drpcGitHubstorj/drpc
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest
go install github.com/grpc-ecosystem/protoc-gen-grpc-gateway-ts@latest
go install github.com/envoyproxy/protoc-gen-validate@latest
#
go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest
go install github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto@latest
go install github.com/srikrsna/protoc-gen-gotag@latest
go install github.com/chrusty/protoc-gen-jsonschema/cmd/protoc-gen-jsonschema@latest
# 调用单个 插件
protoc -I . helloworld.proto --doc_out .依赖包google.golang.org/protobuf/cmd/protoc-gen-goGo 包google.golang.org/protobuf/cmd/protoc-gen-goGogoogle.golang.org/grpc/cmd/protoc-gen-go-grpcGo 包google.golang.org/grpc/cmd/protoc-gen-go-grpcGogithub.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gatewayGo 包github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gatewayGogithub.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2Go 包github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2Gogithub.com/grpc-ecosystem/protoc-gen-grpc-gateway-tsGo 包github.com/grpc-ecosystem/protoc-gen-grpc-gateway-tsGogithub.com/envoyproxy/protoc-gen-validateGo 包github.com/envoyproxy/protoc-gen-validateGogithub.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-docGo 包github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-docGogithub.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtprotoGo 包github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtprotoGogithub.com/srikrsna/protoc-gen-gotagGo 包github.com/srikrsna/protoc-gen-gotagGogithub.com/chrusty/protoc-gen-jsonschema/cmd/protoc-gen-jsonschemaGo 包github.com/chrusty/protoc-gen-jsonschema/cmd/protoc-gen-jsonschemaGo
version: v1
managed:
enabled: true
go_package_prefix:
default: github.com/wenerme/torrenti/pkg/apis
except:
- buf.build/x/bundle
- buf.build/googleapis/googleapis
- buf.build/envoyproxy/protoc-gen-validate
plugins:
- name: go
out: .
opt: paths=source_relative
# - name: gotag
# out: .
# opt: paths=source_relative
- name: go-grpc
out: .
opt: paths=source_relative,require_unimplemented_servers=true
- name: grpc-gateway
out: .
opt:
- paths=source_relative
- generate_unbound_methods=true
#- grpc_api_configuration=path/to/config.yaml
#- standalone=true
- name: openapiv2
out: openapiv2
- name: grpc-gateway-ts
out: gen/web/api
opt: paths=source_relative
- name: doc
out: gen/doc
strategy: all
# <FORMAT>|<TEMPLATE_FILENAME>,<OUT_FILENAME>[,default|source_relative]
# FORMAT=docbook,html,markdown,json
# TEMPLATE_FILENAME Go template 文件
# source_relative 输出基于 input 的相对路径
opt: markdown,proto.md
- name: micro # go micro - web proxy & service
out: .
opt:
- paths=source_relative
- require_unimplemented_servers=false
- name: validate
out: .
opt:
- lang=go
- paths=source_relativesyntax = "proto3";
package acme.weather.v1;
option go_package = "github.com/acme/weather/gen/proto/go/acme/weather/v1;weatherv1";
option java_multiple_files = true;
option java_outer_classname = "WeatherProto";
option java_package = "com.acme.weather.v1";关联信息
反向链接、本文链接的其他页面和外部资料。
参考资料
GitHub55 条
- google/gnosticgithub.com/google/gnostic
- apssouza22/grpc-production-gogithub.com/apssouza22/grpc-production-go
- asim/go-micro/api/proto/api.protogithub.com/asim/go-micro/blob/master/api/proto/api.proto
- bloomrpc/bloomrpcgithub.com/bloomrpc/bloomrpc
- bufbuild/bufgithub.com/bufbuild/buf
- bufbuild/connect-grpcreflect-gogithub.com/bufbuild/connect-grpcreflect-go
- bufbuild/protobuf-esgithub.com/bufbuild/protobuf-es
- bufbuild/protobuf-es/docs/migrating.md#from-protobuf-tsgithub.com/bufbuild/protobuf-es/blob/main/docs/migrating.md
- containerd/ttrpcgithub.com/containerd/ttrpc
- envoyproxy/protoc-gen-validategithub.com/envoyproxy/protoc-gen-validate
- fullstorydev/grpcuigithub.com/fullstorydev/grpcui
- fullstorydev/grpcurlgithub.com/fullstorydev/grpcurl
- getezy/ezygithub.com/getezy/ezy
- google/rejoinergithub.com/google/rejoiner
- googleapis/api-lintergithub.com/googleapis/api-linter
- googleapis/googleapisgithub.com/googleapis/googleapis
- gotway/gotwaygithub.com/gotway/gotway
- grpc-ecosystem/awesome-grpcgithub.com/grpc-ecosystem/awesome-grpc
- grpc-ecosystem/grpc-gatewaygithub.com/grpc-ecosystem/grpc-gateway
- grpc-ecosystem/grpc-gateway#441github.com/grpc-ecosystem/grpc-gateway/issues/441
- grpc-ecosystem/grpc-health-probegithub.com/grpc-ecosystem/grpc-health-probe
- grpc-ecosystem/protoc-gen-grpc-gateway-tsgithub.com/grpc-ecosystem/protoc-gen-grpc-gateway-ts
- grpc/grpc-webgithub.com/grpc/grpc-web
- grpc/grpc/doc/health-checking.mdgithub.com/grpc/grpc/blob/master/doc/health-checking.md
- grpc/grpc/doc/server-reflection.mdgithub.com/grpc/grpc/blob/master/doc/server-reflection.md
- grpc/grpc/src/proto/grpc/lb/v1/load_balancer.protogithub.com/grpc/grpc/blob/master/src/proto/grpc/lb/v1/load_balancer.proto
- improbable-eng/grpc-webgithub.com/improbable-eng/grpc-web
- improbable-eng/ts-protoc-gengithub.com/improbable-eng/ts-protoc-gen
- Kong/insomniagithub.com/Kong/insomnia
- ktr0731/evansgithub.com/ktr0731/evans
- kubeflow/katib/pkg/apisgithub.com/kubeflow/katib/tree/master/pkg/apis
- kubernetes/api/core/v1/generated.protogithub.com/kubernetes/api/blob/master/core/v1/generated.proto
- kubernetes/cri-api/pkg/apis/runtime/v1/api.protogithub.com/kubernetes/cri-api/blob/master/pkg/apis/runtime/v1/api.proto
- liyue201/grpc-lbgithub.com/liyue201/grpc-lb
- mmontes11/go-grpc-routesgithub.com/mmontes11/go-grpc-routes
- mwitkow/grpc-proxygithub.com/mwitkow/grpc-proxy
- onosproject/onos-api/protogithub.com/onosproject/onos-api/tree/master/proto
- p4lang/p4runtime/proto/p4/v1github.com/p4lang/p4runtime/tree/main/proto/p4/v1
- planetscale/vtprotobufgithub.com/planetscale/vtprotobuf
- rogchap/wombatgithub.com/rogchap/wombat
- siderolabs/grpc-proxygithub.com/siderolabs/grpc-proxy
- smallnest/rpcxgithub.com/smallnest/rpcx
- smithy-lang/smithy-typescriptgithub.com/smithy-lang/smithy-typescript
- storj/drpcgithub.com/storj/drpc
- sudorandom/protoc-gen-connect-openapigithub.com/sudorandom/protoc-gen-connect-openapi
- tensorflow/serving/tensorflow_serving/apisgithub.com/tensorflow/serving/tree/master/tensorflow_serving/apis
- thanos-io/thanos/searchgithub.com/thanos-io/thanos/search?p=1&q=in%3Apath+proto
- timostamm/protobuf-tsgithub.com/timostamm/protobuf-ts
- tmc/grpcutilgithub.com/tmc/grpcutil
- twitchtv/twirpgithub.com/twitchtv/twirp
- uber/prototoolgithub.com/uber/prototool
- uw-labs/bloomrpcgithub.com/uw-labs/bloomrpc
- warmuuh/milkmangithub.com/warmuuh/milkman
- wenerme/grpc-protosgithub.com/wenerme/grpc-protos
- ysugimoto/grpc-graphql-gatewaygithub.com/ysugimoto/grpc-graphql-gateway
依赖包1 条
- go.chromium.org/luci/grpc/discoverypkg.go.dev/go.chromium.org/luci/grpc/discovery
其他外链5 条
- etcd.io/docs/latest/op-guide/grpc_proxyetcd.io/docs/latest/op-guide/grpc_proxy
- grpc-ecosystem.github.io/grpc-gatewaygrpc-ecosystem.github.io/grpc-gateway
- grpc.io/blog/grpc-load-balancinggrpc.io/blog/grpc-load-balancing
- microsoft.github.io/reverse-proxy/articles/grpc.htmlmicrosoft.github.io/reverse-proxy/articles/grpc.html
- netflixtechblog.com/practical-api-design-at-netflix-part-1-using-protobuf-fieldmask-35cfdc606518netflixtechblog.com/practical-api-design-at-netflix-part-1-using-protobuf-fieldmask-35cfdc606518