github.com/grpc-ecosystem/grpc-gateway/v2@v2.19.1/examples/internal/proto/examplepb/non_standard_names_grpc.pb.go (about) 1 // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 // versions: 3 // - protoc-gen-go-grpc v1.2.0 4 // - protoc (unknown) 5 // source: examples/internal/proto/examplepb/non_standard_names.proto 6 7 package examplepb 8 9 import ( 10 context "context" 11 grpc "google.golang.org/grpc" 12 codes "google.golang.org/grpc/codes" 13 status "google.golang.org/grpc/status" 14 ) 15 16 // This is a compile-time assertion to ensure that this generated file 17 // is compatible with the grpc package it is being compiled against. 18 // Requires gRPC-Go v1.32.0 or later. 19 const _ = grpc.SupportPackageIsVersion7 20 21 // NonStandardServiceClient is the client API for NonStandardService service. 22 // 23 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 24 type NonStandardServiceClient interface { 25 // Apply field mask to empty NonStandardMessage and return result. 26 Update(ctx context.Context, in *NonStandardUpdateRequest, opts ...grpc.CallOption) (*NonStandardMessage, error) 27 // Apply field mask to empty NonStandardMessageWithJSONNames and return result. 28 UpdateWithJSONNames(ctx context.Context, in *NonStandardWithJSONNamesUpdateRequest, opts ...grpc.CallOption) (*NonStandardMessageWithJSONNames, error) 29 } 30 31 type nonStandardServiceClient struct { 32 cc grpc.ClientConnInterface 33 } 34 35 func NewNonStandardServiceClient(cc grpc.ClientConnInterface) NonStandardServiceClient { 36 return &nonStandardServiceClient{cc} 37 } 38 39 func (c *nonStandardServiceClient) Update(ctx context.Context, in *NonStandardUpdateRequest, opts ...grpc.CallOption) (*NonStandardMessage, error) { 40 out := new(NonStandardMessage) 41 err := c.cc.Invoke(ctx, "/grpc.gateway.examples.internal.proto.examplepb.NonStandardService/Update", in, out, opts...) 42 if err != nil { 43 return nil, err 44 } 45 return out, nil 46 } 47 48 func (c *nonStandardServiceClient) UpdateWithJSONNames(ctx context.Context, in *NonStandardWithJSONNamesUpdateRequest, opts ...grpc.CallOption) (*NonStandardMessageWithJSONNames, error) { 49 out := new(NonStandardMessageWithJSONNames) 50 err := c.cc.Invoke(ctx, "/grpc.gateway.examples.internal.proto.examplepb.NonStandardService/UpdateWithJSONNames", in, out, opts...) 51 if err != nil { 52 return nil, err 53 } 54 return out, nil 55 } 56 57 // NonStandardServiceServer is the server API for NonStandardService service. 58 // All implementations should embed UnimplementedNonStandardServiceServer 59 // for forward compatibility 60 type NonStandardServiceServer interface { 61 // Apply field mask to empty NonStandardMessage and return result. 62 Update(context.Context, *NonStandardUpdateRequest) (*NonStandardMessage, error) 63 // Apply field mask to empty NonStandardMessageWithJSONNames and return result. 64 UpdateWithJSONNames(context.Context, *NonStandardWithJSONNamesUpdateRequest) (*NonStandardMessageWithJSONNames, error) 65 } 66 67 // UnimplementedNonStandardServiceServer should be embedded to have forward compatible implementations. 68 type UnimplementedNonStandardServiceServer struct { 69 } 70 71 func (UnimplementedNonStandardServiceServer) Update(context.Context, *NonStandardUpdateRequest) (*NonStandardMessage, error) { 72 return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") 73 } 74 func (UnimplementedNonStandardServiceServer) UpdateWithJSONNames(context.Context, *NonStandardWithJSONNamesUpdateRequest) (*NonStandardMessageWithJSONNames, error) { 75 return nil, status.Errorf(codes.Unimplemented, "method UpdateWithJSONNames not implemented") 76 } 77 78 // UnsafeNonStandardServiceServer may be embedded to opt out of forward compatibility for this service. 79 // Use of this interface is not recommended, as added methods to NonStandardServiceServer will 80 // result in compilation errors. 81 type UnsafeNonStandardServiceServer interface { 82 mustEmbedUnimplementedNonStandardServiceServer() 83 } 84 85 func RegisterNonStandardServiceServer(s grpc.ServiceRegistrar, srv NonStandardServiceServer) { 86 s.RegisterService(&NonStandardService_ServiceDesc, srv) 87 } 88 89 func _NonStandardService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 90 in := new(NonStandardUpdateRequest) 91 if err := dec(in); err != nil { 92 return nil, err 93 } 94 if interceptor == nil { 95 return srv.(NonStandardServiceServer).Update(ctx, in) 96 } 97 info := &grpc.UnaryServerInfo{ 98 Server: srv, 99 FullMethod: "/grpc.gateway.examples.internal.proto.examplepb.NonStandardService/Update", 100 } 101 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 102 return srv.(NonStandardServiceServer).Update(ctx, req.(*NonStandardUpdateRequest)) 103 } 104 return interceptor(ctx, in, info, handler) 105 } 106 107 func _NonStandardService_UpdateWithJSONNames_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 108 in := new(NonStandardWithJSONNamesUpdateRequest) 109 if err := dec(in); err != nil { 110 return nil, err 111 } 112 if interceptor == nil { 113 return srv.(NonStandardServiceServer).UpdateWithJSONNames(ctx, in) 114 } 115 info := &grpc.UnaryServerInfo{ 116 Server: srv, 117 FullMethod: "/grpc.gateway.examples.internal.proto.examplepb.NonStandardService/UpdateWithJSONNames", 118 } 119 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 120 return srv.(NonStandardServiceServer).UpdateWithJSONNames(ctx, req.(*NonStandardWithJSONNamesUpdateRequest)) 121 } 122 return interceptor(ctx, in, info, handler) 123 } 124 125 // NonStandardService_ServiceDesc is the grpc.ServiceDesc for NonStandardService service. 126 // It's only intended for direct use with grpc.RegisterService, 127 // and not to be introspected or modified (even as a copy) 128 var NonStandardService_ServiceDesc = grpc.ServiceDesc{ 129 ServiceName: "grpc.gateway.examples.internal.proto.examplepb.NonStandardService", 130 HandlerType: (*NonStandardServiceServer)(nil), 131 Methods: []grpc.MethodDesc{ 132 { 133 MethodName: "Update", 134 Handler: _NonStandardService_Update_Handler, 135 }, 136 { 137 MethodName: "UpdateWithJSONNames", 138 Handler: _NonStandardService_UpdateWithJSONNames_Handler, 139 }, 140 }, 141 Streams: []grpc.StreamDesc{}, 142 Metadata: "examples/internal/proto/examplepb/non_standard_names.proto", 143 }