MCPcopy
hub / github.com/golang/protobuf / clientSignature

Function clientSignature

internal/gengogrpc/grpc.go:205–218  ·  view source on GitHub ↗
(g *protogen.GeneratedFile, method *protogen.Method)

Source from the content-addressed store, hash-verified

203}
204
205func clientSignature(g *protogen.GeneratedFile, method *protogen.Method) string {
206 s := method.GoName + "(ctx " + g.QualifiedGoIdent(contextPackage.Ident("Context"))
207 if !method.Desc.IsStreamingClient() {
208 s += ", in *" + g.QualifiedGoIdent(method.Input.GoIdent)
209 }
210 s += ", opts ..." + g.QualifiedGoIdent(grpcPackage.Ident("CallOption")) + ") ("
211 if !method.Desc.IsStreamingClient() && !method.Desc.IsStreamingServer() {
212 s += "*" + g.QualifiedGoIdent(method.Output.GoIdent)
213 } else {
214 s += method.Parent.GoName + "_" + method.GoName + "Client"
215 }
216 s += ", error)"
217 return s
218}
219
220func genClientMethod(gen *protogen.Plugin, file *protogen.File, g *protogen.GeneratedFile, method *protogen.Method, index int) {
221 service := method.Parent

Callers 2

genServiceFunction · 0.85
genClientMethodFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected