class
Analyzer::Go::ConnectRpc
- Analyzer::Go::ConnectRpc
- Analyzer::Go::GoEngine
- Analyzer
- Reference
- Object
Overview
Connect (https://connectrpc.com/) is Buf's gRPC-compatible RPC
framework. Generated handlers expose each service method as
POST /<package>.<Service>/<Method> over plain HTTP, with JSON
and proto content-types negotiated through Content-Type. The
service surface is identical to gRPC's, so we reuse the proto
files already registered by the gRPC detector.
The analyzer is proto-driven by default — every rpc method on
every service in a .proto file becomes one Connect endpoint —
and uses a NewXxxServiceHandler( scan over Go sources to attach
the wired-up service's mount path when available. A code-driven
mount discovery is run alongside so endpoints reference the Go
file that registers the handler instead of (or in addition to)
the proto file.
Defined in:
analyzer/analyzers/go/connect_rpc.crConstant Summary
-
CONNECT_CONTENT_TYPES =
"application/proto, application/json, application/connect+proto, application/connect+json" -
HANDLER_KIND_REGEX =
/connect\.New(Unary|ClientStream|ServerStream|BidiStream)Handler\s*\(\s*(\w+Procedure)/m -
Maps the generated handler-constructor to a streaming descriptor.
-
HANDLER_NAME_REGEX =
/New(\w+ServiceHandler)\s*\(/ -
IMPORT_MARKER =
"connectrpc.com/connect" -
PROCEDURE_REGEX =
/\b(\w+Procedure)\s*=\s*"(\/[\w.]+\/\w+)"/