MCPcopy
hub / github.com/dgraph-io/dgraph / RegisterZeroProxyServer

Function RegisterZeroProxyServer

worker/zero_proxy.go:41–62  ·  view source on GitHub ↗

RegisterZeroProxyServer forwards select GRPC calls over to Zero

(s *grpc.Server)

Source from the content-addressed store, hash-verified

39
40// RegisterZeroProxyServer forwards select GRPC calls over to Zero
41func RegisterZeroProxyServer(s *grpc.Server) {
42 s.RegisterService(&grpc.ServiceDesc{
43 ServiceName: "pb.Zero",
44 HandlerType: (*interface{})(nil), // Don't really need complex type checking here
45 Methods: []grpc.MethodDesc{
46 {
47 MethodName: "AssignIds",
48 Handler: func(
49 srv interface{},
50 ctx context.Context,
51 dec func(interface{}) error,
52 _ grpc.UnaryServerInterceptor) (interface{}, error) {
53 in := new(pb.Num)
54 if err := dec(in); err != nil {
55 return nil, err
56 }
57 return forwardAssignUidsToZero(ctx, in)
58 },
59 },
60 },
61 }, &struct{}{})
62}

Callers 1

serveGRPCFunction · 0.92

Calls 1

forwardAssignUidsToZeroFunction · 0.85

Tested by

no test coverage detected