Skip to content

classtorch/prpc

Repository files navigation

Translate to: 简体中文

pRPC

pRPC is a golang http and grpc protocol client library driven by protobuf, and supports service discovery and load balancing

Architecture

image

Goals

Unifiy http and grpc calls,reduce the code workload of the interface in the process of switching between http and grpc protocols, and try to make users insensitive to the protocol at the code layer

Principle

  • Tool priority: All codes that can be generated by tools are generated by tools, reducing the error rate of handwritten codes and improving development efficiency;
  • Pluggable: increase scalability through good interface design;

Features

  • Generate http and grpc calling codes defined in protobuf through the protoc-gen-go-prpc tool
  • The http client implementation supports extensions;
  • HTTP and grpc client request services support service resolver and load balancing functions, and support expansion;
  • Consul service discovery and the load balancing algorithm of and polling is implemented, and others can be expanded according to needs;
  • Support interceptors, which can easily implement log, trace and other functions;

Getting Started

Required

Installing

code generation tool protoc-gen-go-prpc installation and use:
Install:
go install github.com/classtorch/prpc/cmd/protoc-gen-go-prpc

Use:
protoc --go-prpc_out=:. --go_out=.  -I . api/user.proto

Related

About

A golang http and grpc client library driven by protobuf

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages