How fangfengxiang/lua-resty-yar-grpc-bridge works
This OpenResty library bridges unary RPC calls in both directions: gRPC clients can reach YAR servers, and YAR clients can reach gRPC backends. Each direction has an independent entry point, with service/protobuf configuration and protocol conversion documented in the README. Shared concerns include deadlines, error mapping, payload limits, request IDs, and access logging. The README supports the relationships shown; no source excerpts were available to verify finer internal call ownership.
Main entry points: init.lua gRPC entry · yar2grpc.lua YAR entry · grpc2yar.lua gRPC-YAR conversion
Components 15
gRPC to YAR
- gRPC entry
lib/resty/yar_grpc_bridge/init.lua - gRPC-YAR conversion
lib/resty/yar_grpc_bridge/grpc2yar.lua
YAR to gRPC
- YAR entry
lib/resty/yar_grpc_bridge/yar2grpc.lua - YAR-gRPC conversion
lib/resty/yar_grpc_bridge/yar2grpc.lua
Shared runtime
- Service mapping
lib/resty/yar_grpc_bridge/init.lua - Precompiled descriptors
- Deadline handling
lib/resty/yar_grpc_bridge/grpc2yar.lua - Error mapping
lib/resty/yar_grpc_bridge/grpc2yar.lua - Host adapter
lib/resty/yar_grpc_bridge/host.lua - Request tracing
lib/resty/yar_grpc_bridge/trace.lua - Access logging
lib/resty/yar_grpc_bridge/init.lua
Other components
- gRPC client
- YAR server
- YAR client
- gRPC backend
Connections 10
- gRPC client → gRPC entry: calls
README.md - gRPC entry → gRPC-YAR conversion: serves via
README.md - gRPC-YAR conversion → YAR server: forwards YAR
README.md - YAR client → YAR entry: calls
README.md - YAR entry → YAR-gRPC conversion: handles via
README.md - YAR-gRPC conversion → gRPC backend: forwards gRPC
README.md - Service mapping → gRPC entry: configures
README.md - Service mapping → YAR entry: configures
README.md - Precompiled descriptors → Service mapping: maps services
README.md - gRPC entry → Access logging: logs phase
README.md