class

Analyzer::Go::ConnectRpc

Inherits Analyzer::Go::GoEngine < Analyzer < FileHelper < Reference < Object

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.

Constants

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"
IMPORT_MARKER_RE = Regex.union(IMPORT_MARKER)

Whole-file gates, run on every .go in the tree.

IMPORT_OR_HANDLER_RE = Regex.union(IMPORT_MARKER, "ServiceHandler(")
PROCEDURE_MARKER_RE = /Procedure/
PROCEDURE_REGEX = /\b(\w+Procedure)\s*=\s*"(\/[\w.]+\/\w+)"/

Class methods

tech_name
Source

Instance methods

analyze
Source
tech

Instance-side view of the same declaration. The per-file rescues live on this base class, which has no way to name the analyzer that is running inside them, so a skipped file could not be attributed to a tech. Deriving it from analyzer_for keeps the name written exactly once.

Source

Nested types