Documentation
¶
Overview ¶
Package protoscan reads compiled proto Go stubs to resolve actual Go names for services, RPCs, and messages. Protoc-gen-go may rename identifiers (e.g., P2p → P2P, A2dp → A2Dp) relative to the proto source names. This package bridges that gap.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoNames ¶
type GoNames struct {
// ServiceClients maps service name → actual Go service name.
ServiceClients map[string]string
// RPCMethods maps RPC name → actual Go RPC name.
RPCMethods map[string]string
// MessageTypes maps message name → actual Go message type name.
MessageTypes map[string]string
}
GoNames holds the resolved Go identifiers for a proto package. Each map stores both the exact name and a lowercased key for case-insensitive fallback. Exact matches take priority to avoid collisions when two names differ only in casing (e.g., A2dp vs A2DP).
func Scan ¶
Scan reads the *_grpc.pb.go files in a proto package directory and extracts the actual Go names for services and RPC methods.
func (GoNames) ResolveMessage ¶
ResolveMessage returns the actual Go message type name.
func (GoNames) ResolveRPC ¶
ResolveRPC returns the actual Go RPC method name.
func (GoNames) ResolveService ¶
ResolveService returns the actual Go service name.