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 lowercase service name → actual Go service name.
ServiceClients map[string]string
// RPCMethods maps lowercase RPC name → actual Go RPC name.
RPCMethods map[string]string
// MessageTypes maps lowercase message name → actual Go message type name.
MessageTypes map[string]string
}
GoNames holds the resolved Go identifiers for a proto package.
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 (as generated by protoc-gen-go), falling back to the input if no resolution is found. Protoc-gen-go may rename identifiers (e.g., P2p -> P2P, A2dp -> A2Dp).
func (GoNames) ResolveRPC ¶
ResolveRPC returns the actual Go RPC method name, falling back to the input if no resolution is found.
func (GoNames) ResolveService ¶
ResolveService returns the actual Go service name, falling back to the input if no resolution is found.