diff options
author | John Cai <jcai@gitlab.com> | 2019-12-06 21:06:56 +0300 |
---|---|---|
committer | John Cai <jcai@gitlab.com> | 2019-12-08 19:07:00 +0300 |
commit | 66fb80ff71e5d76b2e9afba01dfe5d606ddef33a (patch) | |
tree | 839249c37b27a6e5c0b8c5b57553457417f73f7e | |
parent | b4379bb6de838ea1188140e70cf7c5f13960eb1d (diff) |
Change hook rpcs to streaming
-rw-r--r-- | proto/go/gitalypb/hook.pb.go | 296 | ||||
-rw-r--r-- | proto/hook.proto | 6 | ||||
-rw-r--r-- | ruby/proto/gitaly/hook_services_pb.rb | 6 |
3 files changed, 200 insertions, 108 deletions
diff --git a/proto/go/gitalypb/hook.pb.go b/proto/go/gitalypb/hook.pb.go index d0ce04f17..160519b49 100644 --- a/proto/go/gitalypb/hook.pb.go +++ b/proto/go/gitalypb/hook.pb.go @@ -390,33 +390,34 @@ func init() { func init() { proto.RegisterFile("hook.proto", fileDescriptor_3eef30da1c11ee1b) } var fileDescriptor_3eef30da1c11ee1b = []byte{ - // 415 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0x96, 0x13, 0x12, 0xe2, 0x69, 0xc4, 0xcf, 0x8a, 0x06, 0x63, 0x04, 0x44, 0x3e, 0xf9, 0x82, - 0x0d, 0xe1, 0x0d, 0x38, 0xc1, 0x05, 0x55, 0x8b, 0xe0, 0x50, 0x09, 0x2a, 0xdb, 0x3b, 0xa4, 0x96, - 0x8d, 0xc7, 0xec, 0xae, 0x53, 0xf9, 0x3d, 0x90, 0xe0, 0x19, 0x78, 0x44, 0x4e, 0xc8, 0xbb, 0x4e, - 0x1a, 0xea, 0xf4, 0xd6, 0xde, 0xf6, 0x9b, 0x6f, 0x67, 0xe6, 0xfb, 0x66, 0x76, 0x01, 0xce, 0x89, - 0x8a, 0xa8, 0x96, 0xa4, 0x89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 0xc5, 0xd9, 0x26, 0x29, 0x1b, 0x34, 0x0b, - 0x75, 0xf9, 0x8c, 0x4a, 0xf1, 0xb9, 0xc3, 0x1d, 0x59, 0xe1, 0x45, 0x4f, 0x4e, 0x2c, 0x59, 0xe1, - 0x85, 0x21, 0x83, 0xaf, 0xc0, 0xf6, 0xb5, 0xde, 0xf4, 0x30, 0x56, 0xbf, 0x47, 0x70, 0xd4, 0x95, - 0xfe, 0x88, 0x72, 0x93, 0x67, 0xc8, 0x4e, 0xe1, 0xde, 0xff, 0x0f, 0x8c, 0x3d, 0xdb, 0x0e, 0xe1, - 0xe0, 0x77, 0xf0, 0x9f, 0x5f, 0x47, 0x5b, 0xa9, 0x81, 0xfb, 0xf7, 0x57, 0x38, 0x99, 0x8d, 0x7c, - 0xe7, 0x35, 0xfb, 0x02, 0xf7, 0xaf, 0x6c, 0x97, 0x5d, 0x66, 0x1f, 0x7c, 0x71, 0xfe, 0x8b, 0x6b, - 0xf9, 0x61, 0xf9, 0x0f, 0x00, 0x97, 0xa3, 0x62, 0x4f, 0xb6, 0x99, 0x83, 0x55, 0xfb, 0xfe, 0x21, - 0x6a, 0x50, 0xef, 0xed, 0xab, 0xd3, 0xee, 0x5e, 0x99, 0xa4, 0x51, 0x46, 0xdf, 0x63, 0x7b, 0x7c, - 0x49, 0x72, 0x1d, 0xdb, 0xec, 0xd8, 0x7c, 0xd5, 0x78, 0x4d, 0x3d, 0xae, 0xd3, 0x74, 0x6a, 0x42, - 0x6f, 0xfe, 0x05, 0x00, 0x00, 0xff, 0xff, 0x74, 0x46, 0x6b, 0x70, 0x5f, 0x04, 0x00, 0x00, + // 419 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0x4d, 0x8f, 0xd3, 0x30, + 0x10, 0x95, 0x5b, 0x5a, 0xda, 0xd9, 0x8a, 0x0f, 0x8b, 0x2d, 0x21, 0x08, 0xa8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, 0x36, 0xd4, 0xe2, 0x32, + 0x8e, 0x87, 0x36, 0xf4, 0xfe, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa5, 0xca, 0x64, 0xd9, 0x69, + 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -431,9 +432,9 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type HookServiceClient interface { - PreReceiveHook(ctx context.Context, in *PreReceiveHookRequest, opts ...grpc.CallOption) (*PreReceiveHookResponse, error) - PostReceiveHook(ctx context.Context, in *PostReceiveHookRequest, opts ...grpc.CallOption) (*PostReceiveHookResponse, error) - UpdateHook(ctx context.Context, in *UpdateHookRequest, opts ...grpc.CallOption) (*UpdateHookResponse, error) + PreReceiveHook(ctx context.Context, opts ...grpc.CallOption) (HookService_PreReceiveHookClient, error) + PostReceiveHook(ctx context.Context, opts ...grpc.CallOption) (HookService_PostReceiveHookClient, error) + UpdateHook(ctx context.Context, in *UpdateHookRequest, opts ...grpc.CallOption) (HookService_UpdateHookClient, error) } type hookServiceClient struct { @@ -444,129 +445,220 @@ func NewHookServiceClient(cc *grpc.ClientConn) HookServiceClient { return &hookServiceClient{cc} } -func (c *hookServiceClient) PreReceiveHook(ctx context.Context, in *PreReceiveHookRequest, opts ...grpc.CallOption) (*PreReceiveHookResponse, error) { - out := new(PreReceiveHookResponse) - err := c.cc.Invoke(ctx, "/gitaly.HookService/PreReceiveHook", in, out, opts...) +func (c *hookServiceClient) PreReceiveHook(ctx context.Context, opts ...grpc.CallOption) (HookService_PreReceiveHookClient, error) { + stream, err := c.cc.NewStream(ctx, &_HookService_serviceDesc.Streams[0], "/gitaly.HookService/PreReceiveHook", opts...) if err != nil { return nil, err } - return out, nil + x := &hookServicePreReceiveHookClient{stream} + return x, nil } -func (c *hookServiceClient) PostReceiveHook(ctx context.Context, in *PostReceiveHookRequest, opts ...grpc.CallOption) (*PostReceiveHookResponse, error) { - out := new(PostReceiveHookResponse) - err := c.cc.Invoke(ctx, "/gitaly.HookService/PostReceiveHook", in, out, opts...) +type HookService_PreReceiveHookClient interface { + Send(*PreReceiveHookRequest) error + Recv() (*PreReceiveHookResponse, error) + grpc.ClientStream +} + +type hookServicePreReceiveHookClient struct { + grpc.ClientStream +} + +func (x *hookServicePreReceiveHookClient) Send(m *PreReceiveHookRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *hookServicePreReceiveHookClient) Recv() (*PreReceiveHookResponse, error) { + m := new(PreReceiveHookResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *hookServiceClient) PostReceiveHook(ctx context.Context, opts ...grpc.CallOption) (HookService_PostReceiveHookClient, error) { + stream, err := c.cc.NewStream(ctx, &_HookService_serviceDesc.Streams[1], "/gitaly.HookService/PostReceiveHook", opts...) if err != nil { return nil, err } - return out, nil + x := &hookServicePostReceiveHookClient{stream} + return x, nil +} + +type HookService_PostReceiveHookClient interface { + Send(*PostReceiveHookRequest) error + Recv() (*PostReceiveHookResponse, error) + grpc.ClientStream +} + +type hookServicePostReceiveHookClient struct { + grpc.ClientStream +} + +func (x *hookServicePostReceiveHookClient) Send(m *PostReceiveHookRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *hookServicePostReceiveHookClient) Recv() (*PostReceiveHookResponse, error) { + m := new(PostReceiveHookResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil } -func (c *hookServiceClient) UpdateHook(ctx context.Context, in *UpdateHookRequest, opts ...grpc.CallOption) (*UpdateHookResponse, error) { - out := new(UpdateHookResponse) - err := c.cc.Invoke(ctx, "/gitaly.HookService/UpdateHook", in, out, opts...) +func (c *hookServiceClient) UpdateHook(ctx context.Context, in *UpdateHookRequest, opts ...grpc.CallOption) (HookService_UpdateHookClient, error) { + stream, err := c.cc.NewStream(ctx, &_HookService_serviceDesc.Streams[2], "/gitaly.HookService/UpdateHook", opts...) if err != nil { return nil, err } - return out, nil + x := &hookServiceUpdateHookClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type HookService_UpdateHookClient interface { + Recv() (*UpdateHookResponse, error) + grpc.ClientStream +} + +type hookServiceUpdateHookClient struct { + grpc.ClientStream +} + +func (x *hookServiceUpdateHookClient) Recv() (*UpdateHookResponse, error) { + m := new(UpdateHookResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil } // HookServiceServer is the server API for HookService service. type HookServiceServer interface { - PreReceiveHook(context.Context, *PreReceiveHookRequest) (*PreReceiveHookResponse, error) - PostReceiveHook(context.Context, *PostReceiveHookRequest) (*PostReceiveHookResponse, error) - UpdateHook(context.Context, *UpdateHookRequest) (*UpdateHookResponse, error) + PreReceiveHook(HookService_PreReceiveHookServer) error + PostReceiveHook(HookService_PostReceiveHookServer) error + UpdateHook(*UpdateHookRequest, HookService_UpdateHookServer) error } // UnimplementedHookServiceServer can be embedded to have forward compatible implementations. type UnimplementedHookServiceServer struct { } -func (*UnimplementedHookServiceServer) PreReceiveHook(ctx context.Context, req *PreReceiveHookRequest) (*PreReceiveHookResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PreReceiveHook not implemented") +func (*UnimplementedHookServiceServer) PreReceiveHook(srv HookService_PreReceiveHookServer) error { + return status.Errorf(codes.Unimplemented, "method PreReceiveHook not implemented") } -func (*UnimplementedHookServiceServer) PostReceiveHook(ctx context.Context, req *PostReceiveHookRequest) (*PostReceiveHookResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PostReceiveHook not implemented") +func (*UnimplementedHookServiceServer) PostReceiveHook(srv HookService_PostReceiveHookServer) error { + return status.Errorf(codes.Unimplemented, "method PostReceiveHook not implemented") } -func (*UnimplementedHookServiceServer) UpdateHook(ctx context.Context, req *UpdateHookRequest) (*UpdateHookResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateHook not implemented") +func (*UnimplementedHookServiceServer) UpdateHook(req *UpdateHookRequest, srv HookService_UpdateHookServer) error { + return status.Errorf(codes.Unimplemented, "method UpdateHook not implemented") } func RegisterHookServiceServer(s *grpc.Server, srv HookServiceServer) { s.RegisterService(&_HookService_serviceDesc, srv) } -func _HookService_PreReceiveHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PreReceiveHookRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(HookServiceServer).PreReceiveHook(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gitaly.HookService/PreReceiveHook", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(HookServiceServer).PreReceiveHook(ctx, req.(*PreReceiveHookRequest)) - } - return interceptor(ctx, in, info, handler) +func _HookService_PreReceiveHook_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(HookServiceServer).PreReceiveHook(&hookServicePreReceiveHookServer{stream}) +} + +type HookService_PreReceiveHookServer interface { + Send(*PreReceiveHookResponse) error + Recv() (*PreReceiveHookRequest, error) + grpc.ServerStream +} + +type hookServicePreReceiveHookServer struct { + grpc.ServerStream +} + +func (x *hookServicePreReceiveHookServer) Send(m *PreReceiveHookResponse) error { + return x.ServerStream.SendMsg(m) } -func _HookService_PostReceiveHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PostReceiveHookRequest) - if err := dec(in); err != nil { +func (x *hookServicePreReceiveHookServer) Recv() (*PreReceiveHookRequest, error) { + m := new(PreReceiveHookRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { return nil, err } - if interceptor == nil { - return srv.(HookServiceServer).PostReceiveHook(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gitaly.HookService/PostReceiveHook", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(HookServiceServer).PostReceiveHook(ctx, req.(*PostReceiveHookRequest)) - } - return interceptor(ctx, in, info, handler) + return m, nil +} + +func _HookService_PostReceiveHook_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(HookServiceServer).PostReceiveHook(&hookServicePostReceiveHookServer{stream}) } -func _HookService_UpdateHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateHookRequest) - if err := dec(in); err != nil { +type HookService_PostReceiveHookServer interface { + Send(*PostReceiveHookResponse) error + Recv() (*PostReceiveHookRequest, error) + grpc.ServerStream +} + +type hookServicePostReceiveHookServer struct { + grpc.ServerStream +} + +func (x *hookServicePostReceiveHookServer) Send(m *PostReceiveHookResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *hookServicePostReceiveHookServer) Recv() (*PostReceiveHookRequest, error) { + m := new(PostReceiveHookRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { return nil, err } - if interceptor == nil { - return srv.(HookServiceServer).UpdateHook(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gitaly.HookService/UpdateHook", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(HookServiceServer).UpdateHook(ctx, req.(*UpdateHookRequest)) + return m, nil +} + +func _HookService_UpdateHook_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(UpdateHookRequest) + if err := stream.RecvMsg(m); err != nil { + return err } - return interceptor(ctx, in, info, handler) + return srv.(HookServiceServer).UpdateHook(m, &hookServiceUpdateHookServer{stream}) +} + +type HookService_UpdateHookServer interface { + Send(*UpdateHookResponse) error + grpc.ServerStream +} + +type hookServiceUpdateHookServer struct { + grpc.ServerStream +} + +func (x *hookServiceUpdateHookServer) Send(m *UpdateHookResponse) error { + return x.ServerStream.SendMsg(m) } var _HookService_serviceDesc = grpc.ServiceDesc{ ServiceName: "gitaly.HookService", HandlerType: (*HookServiceServer)(nil), - Methods: []grpc.MethodDesc{ + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ { - MethodName: "PreReceiveHook", - Handler: _HookService_PreReceiveHook_Handler, + StreamName: "PreReceiveHook", + Handler: _HookService_PreReceiveHook_Handler, + ServerStreams: true, + ClientStreams: true, }, { - MethodName: "PostReceiveHook", - Handler: _HookService_PostReceiveHook_Handler, + StreamName: "PostReceiveHook", + Handler: _HookService_PostReceiveHook_Handler, + ServerStreams: true, + ClientStreams: true, }, { - MethodName: "UpdateHook", - Handler: _HookService_UpdateHook_Handler, + StreamName: "UpdateHook", + Handler: _HookService_UpdateHook_Handler, + ServerStreams: true, }, }, - Streams: []grpc.StreamDesc{}, Metadata: "hook.proto", } diff --git a/proto/hook.proto b/proto/hook.proto index 2410d3b28..487692d1e 100644 --- a/proto/hook.proto +++ b/proto/hook.proto @@ -7,19 +7,19 @@ option go_package = "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"; import "shared.proto"; service HookService { - rpc PreReceiveHook(PreReceiveHookRequest) returns (PreReceiveHookResponse) { + rpc PreReceiveHook(stream PreReceiveHookRequest) returns (stream PreReceiveHookResponse) { option (op_type) = { op: ACCESSOR target_repository_field: "1" }; } - rpc PostReceiveHook(PostReceiveHookRequest) returns (PostReceiveHookResponse) { + rpc PostReceiveHook(stream PostReceiveHookRequest) returns (stream PostReceiveHookResponse) { option (op_type) = { op: ACCESSOR target_repository_field: "1" }; } - rpc UpdateHook(UpdateHookRequest) returns (UpdateHookResponse) { + rpc UpdateHook(UpdateHookRequest) returns (stream UpdateHookResponse) { option (op_type) = { op: ACCESSOR target_repository_field: "1" diff --git a/ruby/proto/gitaly/hook_services_pb.rb b/ruby/proto/gitaly/hook_services_pb.rb index a57be1c36..42d79188e 100644 --- a/ruby/proto/gitaly/hook_services_pb.rb +++ b/ruby/proto/gitaly/hook_services_pb.rb @@ -14,9 +14,9 @@ module Gitaly self.unmarshal_class_method = :decode self.service_name = 'gitaly.HookService' - rpc :PreReceiveHook, PreReceiveHookRequest, PreReceiveHookResponse - rpc :PostReceiveHook, PostReceiveHookRequest, PostReceiveHookResponse - rpc :UpdateHook, UpdateHookRequest, UpdateHookResponse + rpc :PreReceiveHook, stream(PreReceiveHookRequest), stream(PreReceiveHookResponse) + rpc :PostReceiveHook, stream(PostReceiveHookRequest), stream(PostReceiveHookResponse) + rpc :UpdateHook, UpdateHookRequest, stream(UpdateHookResponse) end Stub = Service.rpc_stub_class |