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

Method generateUnimplementedServer

protoc-gen-go/grpc/grpc.go:265–276  ·  view source on GitHub ↗

generateUnimplementedServer creates the unimplemented server struct

(servName string, service *pb.ServiceDescriptorProto)

Source from the content-addressed store, hash-verified

263
264// generateUnimplementedServer creates the unimplemented server struct
265func (g *grpc) generateUnimplementedServer(servName string, service *pb.ServiceDescriptorProto) {
266 serverType := servName + "Server"
267 g.P("// Unimplemented", serverType, " can be embedded to have forward compatible implementations.")
268 g.P("type Unimplemented", serverType, " struct {")
269 g.P("}")
270 g.P()
271 // Unimplemented<service_name>Server's concrete methods
272 for _, method := range service.Method {
273 g.generateServerMethodConcrete(servName, method)
274 }
275 g.P()
276}
277
278// generateServerMethodConcrete returns unimplemented methods which ensure forward compatibility
279func (g *grpc) generateServerMethodConcrete(servName string, method *pb.MethodDescriptorProto) {

Callers 1

generateServiceMethod · 0.95

Calls 2

PMethod · 0.95

Tested by

no test coverage detected