Download the PHP package reatang/grpc-php-abstract without Composer
On this page you can find all versions of the php package reatang/grpc-php-abstract. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download reatang/grpc-php-abstract
More information about reatang/grpc-php-abstract
Files in reatang/grpc-php-abstract
Download reatang/grpc-php-abstract
More information about reatang/grpc-php-abstract
Files in reatang/grpc-php-abstract
Vendor reatang
Package grpc-php-abstract
Short Description php兼容 grpc原生客户端 和 grpc-gateway 调用
License MIT
Homepage https://github.com/reatang/grpc-php-abstract
Package grpc-php-abstract
Short Description php兼容 grpc原生客户端 和 grpc-gateway 调用
License MIT
Homepage https://github.com/reatang/grpc-php-abstract
Please rate this library. Is it a good library?
Informations about the package grpc-php-abstract
grpc-php-abstract
abstract grpc and grpc-gateway
- [x] 提供grpc原生客户端 和 grcp-gateway调用的抽象层
- [x] 添加解析 protobuf Any 参数的工具 UtilAny
- [x] 一元请求重试中间件
- [x] 支持配置化的默认调用行为
- [x] 支持OpenTelemetry链路追踪(grpc、gateway都已支持)
- [x] 开发自动生成grpc原生客户端抽象层 protoc-gen-php-abs-grpc
- [x] 开发自动生成grpc-gateway抽象层:
--php-abs-grpc_opt=genType=gateway
则生成gateway抽象层
安装
使用
本教程假定您已经知道 protobuf
、grpc
的基础知识,并预先学习了 protoc-gen-php-abs-grpc 生成器的功能。
业务错误信息传递方案
在golang的grpc业务处理中,一般返回值是两个:
这第二个error参数如果不是标准的grpc错误码,则对应这grpc的status则是:code:2, details: error的内容
。
那么我就可以利用这个error的内容做一个简单的数据格式用来携带错误。
我的details内容格式则是:
按照这种格式传输的details,则会自动抛出 GrpcBusinessException
异常。
注意
- 2023-07-06:protobuf 3.23 是支持 php7.4的最后一个版本,使用php7.4的同学
不要
再用更新的版本了,相关新闻
文档列表
- PHP grpc 使用文档:https://grpc.io/docs/languages/php
- PHP grpc 源码文档:https://github.com/grpc/grpc/tree/master/src/php
鸣谢
感谢jetbrains 对开源项目提供的支持
All versions of grpc-php-abstract with dependencies
PHP Build Version
Package Version
Requires
php Version
^7.4
ext-json Version *
grpc/grpc Version 1.52.*
google/protobuf Version v3.21.12
ext-protobuf Version *
ext-grpc Version *
guzzlehttp/guzzle Version ^7.5
psr/log Version ^1.0.1
open-telemetry/api Version ^1.0
open-telemetry/context Version ^1.0
open-telemetry/sdk Version ^1.0
open-telemetry/sem-conv Version ^1.0
ext-json Version *
grpc/grpc Version 1.52.*
google/protobuf Version v3.21.12
ext-protobuf Version *
ext-grpc Version *
guzzlehttp/guzzle Version ^7.5
psr/log Version ^1.0.1
open-telemetry/api Version ^1.0
open-telemetry/context Version ^1.0
open-telemetry/sdk Version ^1.0
open-telemetry/sem-conv Version ^1.0
The package reatang/grpc-php-abstract contains the following files
Loading the files please wait ....