diff --git a/.gitignore b/.gitignore index 4482aa3de333e0b68243fa8faf3d6c536e5203fa..a75bb6a9e91ee8835fb795e40c013eb29d387d03 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ git-env /praefect gitaly.pid /vendor/github.com/libgit2/git2go/vendor + +.idea diff --git a/internal/git/catfile/catfile.go b/internal/git/catfile/catfile.go index 288470170e3858241f32ecef6afca49baa134fd6..553c80873d61e8ac8a1e7ff4cf43a36868533179 100644 --- a/internal/git/catfile/catfile.go +++ b/internal/git/catfile/catfile.go @@ -65,6 +65,14 @@ func (c *Batch) Info(revspec string) (*ObjectInfo, error) { return c.batchCheck.info(revspec) } +// Object returns a raw object. It is an error if revspec does not +// point to a expectedType. To prevent this firstuse Info to resolve the revspec +// and check the object type. Caller must consume the Reader before +// making another call on C. +func (c Batch) Object(revspec string, expectedType string) (io.Reader, error) { + return c.batchProcess.reader(revspec, expectedType) +} + // Tree returns a raw tree object. It is an error if revspec does not // point to a tree. To prevent this firstuse Info to resolve the revspec // and check the object type. Caller must consume the Reader before diff --git a/internal/service/server/get_objects.go b/internal/service/server/get_objects.go new file mode 100644 index 0000000000000000000000000000000000000000..e4f66ed412e5d9b79af58767eb60fb0a8abcad59 --- /dev/null +++ b/internal/service/server/get_objects.go @@ -0,0 +1,91 @@ +package server + +import ( + "fmt" + "io" + "io/ioutil" + + "github.com/sirupsen/logrus" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/git/catfile" + "gitlab.com/gitlab-org/gitaly/streamio" +) + +func (s *server) GetObjects(in *gitalypb.GetObjectsRequest, stream gitalypb.ServerService_GetObjectsServer) error { + if err := validateGetObjectsRequest(in); err != nil { + return status.Errorf(codes.InvalidArgument, "GetObjects: %v", err) + } + + c, err := catfile.New(stream.Context(), in.Repository) + if err != nil { + return status.Errorf(codes.Internal, "GetObjects: %v", err) + } + + for _, oid := range in.Oids { + objectInfo, err := c.Info(oid) + if err != nil && !catfile.IsNotFound(err) { + return status.Errorf(codes.Internal, "GetObjects: %v", err) + } + if catfile.IsNotFound(err) { + logrus.WithField("oid", oid).Error("not found oid") + } + response := &gitalypb.GetObjectsResponse{ + Size: objectInfo.Size, + Oid: objectInfo.Oid, + Type: lookupType(objectInfo.Type), + } + reader, err := c.Object(objectInfo.Oid, objectInfo.Type) + if err != nil { + return status.Errorf(codes.Internal, "GetObjects: %v", err) + } + + sw := streamio.NewWriter(func(p []byte) error { + msg := &gitalypb.GetObjectsResponse{} + if response != nil { + msg = response + response = nil + } + + msg.Data = p + + return stream.Send(msg) + }) + + _, err = io.Copy(sw, reader) + if err != nil { + return status.Errorf(codes.Unavailable, "GetObjects: send: %v", err) + } + + if _, err := io.Copy(ioutil.Discard, reader); err != nil { + return status.Errorf(codes.Unavailable, "GetObjects: discarding data: %v", err) + } + + } + + return nil +} + +func validateGetObjectsRequest(in *gitalypb.GetObjectsRequest) error { + if len(in.GetOids()) == 0 { + return fmt.Errorf("empty Oids") + } + return nil +} + +func lookupType(infoType string) gitalypb.ObjectType { + switch infoType { + case "commit": + return gitalypb.ObjectType_COMMIT + case "blob": + return gitalypb.ObjectType_BLOB + case "tree": + return gitalypb.ObjectType_TREE + case "tag": + return gitalypb.ObjectType_TAG + default: + return gitalypb.ObjectType_UNKNOWN + } +} diff --git a/internal/service/server/pack_objects.go b/internal/service/server/pack_objects.go new file mode 100644 index 0000000000000000000000000000000000000000..a2c5519c35bd8062cb72bfb703e166920ee17f3a --- /dev/null +++ b/internal/service/server/pack_objects.go @@ -0,0 +1,140 @@ +package server + +import ( + "bufio" + "context" + "fmt" + "strings" + + "github.com/sirupsen/logrus" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/git" + "gitlab.com/gitlab-org/gitaly/internal/git/alternates" + "gitlab.com/gitlab-org/gitaly/internal/git/catfile" + "gitlab.com/gitlab-org/gitaly/streamio" +) + +func (s *server) ReceivePack(in *gitalypb.ReceivePackRequest, stream gitalypb.ServerService_ReceivePackServer) error { + ctx := stream.Context() + + if err := validateReceivePackRequest(in); err != nil { + return status.Errorf(codes.InvalidArgument, "ReceivePack: %v", err) + } + + c, err := catfile.New(ctx, in.Repository) + if err != nil { + return status.Errorf(codes.Internal, "ReceivePack: %v", err) + } + + var ( + objectIDs []string + commitIDs []string + shouldDepth = in.Depth > 1 + ) + + for _, oid := range in.Oids { + objectInfo, err := c.Info(oid) + if err != nil && !catfile.IsNotFound(err) { + return status.Errorf(codes.Internal, "ReceivePack: %v", err) + } + if catfile.IsNotFound(err) { + logrus.WithField("oid", oid).Error("not found oid") + } + if objectInfo.Type == "commit" { + if !shouldDepth { + commitIDs = append(commitIDs, oid) + } else { + cmdArgs := []string{"rev-list", fmt.Sprintf("-%d", in.Depth), oid} + revList, err := git.Command(ctx, in.GetRepository(), cmdArgs...) + if err != nil { + return err + } + + scanner := bufio.NewScanner(revList) + for scanner.Scan() { + commitIDs = append(commitIDs, scanner.Text()) + } + if err := revList.Wait(); err != nil { + return err + } + } + } + objectIDs = append(objectIDs, oid) + } + + for _, oid := range commitIDs { + list, err := treeList(ctx, in.Repository, oid, "commit") + if err != nil { + return err + } + objectIDs = append(objectIDs, list...) + } + + stdout := streamio.NewWriter(func(p []byte) error { + return stream.Send(&gitalypb.ReceivePackResponse{Data: p}) + }) + + repoPath, env, err := alternates.PathAndEnv(in.Repository) + if err != nil { + return err + } + args := append([]string{"--git-dir", repoPath}, "pack-objects", "--stdout") + objects := strings.Join(objectIDs, "\n") + cmd, err := git.BareCommand(ctx, strings.NewReader(objects), stdout, nil, env, args...) + if err != nil { + return status.Errorf(codes.Unavailable, "PostReceivePack: %v, stdin: %s", err, objects) + } + if err := cmd.Wait(); err != nil { + return status.Errorf(codes.Unavailable, "PostReceivePack: %v, stdin: %s", err, objects) + } + return nil +} + +func validateReceivePackRequest(in *gitalypb.ReceivePackRequest) error { + if len(in.GetOids()) == 0 { + return fmt.Errorf("empty Oids") + } + return nil +} + +func treeList(ctx context.Context, repository *gitalypb.Repository, oid string, objectType string) ([]string, error) { + var parent []string + cmd, err := git.Command(ctx, repository, "cat-file", "-p", oid) + if err != nil { + return nil, err + } + scanner := bufio.NewScanner(cmd) + if objectType == "commit" { + if scanner.Scan() { + line := scanner.Text() + treeID := line[5:45] + parent = append(parent, treeID) + sub, err := treeList(ctx, repository, treeID, "tree") + if err != nil { + return nil, err + } + parent = append(parent, sub...) + } + + } else { + for scanner.Scan() { + line := scanner.Text() + if line[7:11] == "tree" { + treeID := line[12:52] + parent = append(parent, treeID) + sub, err := treeList(ctx, repository, treeID, "tree") + if err != nil { + return nil, err + } + parent = append(parent, sub...) + } + } + } + if err := cmd.Wait(); err != nil { + return nil, err + } + return parent, nil +} diff --git a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/gitalypb/go.mod b/vendor/gitlab.com/gitlab-org/gitaly-proto/go/gitalypb/go.mod deleted file mode 100644 index 05161ff60a811fb2bdd4a6a0bc5ea5baacb6008f..0000000000000000000000000000000000000000 --- a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/gitalypb/go.mod +++ /dev/null @@ -1 +0,0 @@ -module gitlab.com/gitlab-org/gitaly-proto/go/gitalypb diff --git a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/gitalypb/server.pb.go b/vendor/gitlab.com/gitlab-org/gitaly-proto/go/gitalypb/server.pb.go index 4c482de6bcf1e8252b9c6f7f9dd851cb2222843c..8330ec9f2f275107f39ce4f3fe52dcf649d16dec 100644 --- a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/gitalypb/server.pb.go +++ b/vendor/gitlab.com/gitlab-org/gitaly-proto/go/gitalypb/server.pb.go @@ -33,7 +33,7 @@ func (m *ServerInfoRequest) Reset() { *m = ServerInfoRequest{} } func (m *ServerInfoRequest) String() string { return proto.CompactTextString(m) } func (*ServerInfoRequest) ProtoMessage() {} func (*ServerInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_server_636aea99a5d9572b, []int{0} + return fileDescriptor_server_f3182e3be274f50f, []int{0} } func (m *ServerInfoRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ServerInfoRequest.Unmarshal(m, b) @@ -66,7 +66,7 @@ func (m *ServerInfoResponse) Reset() { *m = ServerInfoResponse{} } func (m *ServerInfoResponse) String() string { return proto.CompactTextString(m) } func (*ServerInfoResponse) ProtoMessage() {} func (*ServerInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_server_636aea99a5d9572b, []int{1} + return fileDescriptor_server_f3182e3be274f50f, []int{1} } func (m *ServerInfoResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ServerInfoResponse.Unmarshal(m, b) @@ -120,7 +120,7 @@ func (m *ServerInfoResponse_StorageStatus) Reset() { *m = ServerInfoResp func (m *ServerInfoResponse_StorageStatus) String() string { return proto.CompactTextString(m) } func (*ServerInfoResponse_StorageStatus) ProtoMessage() {} func (*ServerInfoResponse_StorageStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_server_636aea99a5d9572b, []int{1, 0} + return fileDescriptor_server_f3182e3be274f50f, []int{1, 0} } func (m *ServerInfoResponse_StorageStatus) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ServerInfoResponse_StorageStatus.Unmarshal(m, b) @@ -161,10 +161,221 @@ func (m *ServerInfoResponse_StorageStatus) GetWriteable() bool { return false } +type GetObjectsRequest struct { + Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` + // Object IDs (SHA1) of the object we want to get + Oids []string `protobuf:"bytes,2,rep,name=oids,proto3" json:"oids,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetObjectsRequest) Reset() { *m = GetObjectsRequest{} } +func (m *GetObjectsRequest) String() string { return proto.CompactTextString(m) } +func (*GetObjectsRequest) ProtoMessage() {} +func (*GetObjectsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_server_f3182e3be274f50f, []int{2} +} +func (m *GetObjectsRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetObjectsRequest.Unmarshal(m, b) +} +func (m *GetObjectsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetObjectsRequest.Marshal(b, m, deterministic) +} +func (dst *GetObjectsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetObjectsRequest.Merge(dst, src) +} +func (m *GetObjectsRequest) XXX_Size() int { + return xxx_messageInfo_GetObjectsRequest.Size(m) +} +func (m *GetObjectsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetObjectsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetObjectsRequest proto.InternalMessageInfo + +func (m *GetObjectsRequest) GetRepository() *Repository { + if m != nil { + return m.Repository + } + return nil +} + +func (m *GetObjectsRequest) GetOids() []string { + if m != nil { + return m.Oids + } + return nil +} + +type GetObjectsResponse struct { + // Object size; present only in first response message + Size int64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` + // Chunk of Object data + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + // Object ID of the actual object returned. Empty if no object was found. + Oid string `protobuf:"bytes,3,opt,name=oid,proto3" json:"oid,omitempty"` + // Object Type of the actual object returned. Empty if no object was found. + Type ObjectType `protobuf:"varint,4,opt,name=type,proto3,enum=gitaly.ObjectType" json:"type,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetObjectsResponse) Reset() { *m = GetObjectsResponse{} } +func (m *GetObjectsResponse) String() string { return proto.CompactTextString(m) } +func (*GetObjectsResponse) ProtoMessage() {} +func (*GetObjectsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_server_f3182e3be274f50f, []int{3} +} +func (m *GetObjectsResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetObjectsResponse.Unmarshal(m, b) +} +func (m *GetObjectsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetObjectsResponse.Marshal(b, m, deterministic) +} +func (dst *GetObjectsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetObjectsResponse.Merge(dst, src) +} +func (m *GetObjectsResponse) XXX_Size() int { + return xxx_messageInfo_GetObjectsResponse.Size(m) +} +func (m *GetObjectsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetObjectsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetObjectsResponse proto.InternalMessageInfo + +func (m *GetObjectsResponse) GetSize() int64 { + if m != nil { + return m.Size + } + return 0 +} + +func (m *GetObjectsResponse) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +func (m *GetObjectsResponse) GetOid() string { + if m != nil { + return m.Oid + } + return "" +} + +func (m *GetObjectsResponse) GetType() ObjectType { + if m != nil { + return m.Type + } + return ObjectType_UNKNOWN +} + +type ReceivePackRequest struct { + Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` + // Object IDs (SHA1) of the object we want to get + Oids []string `protobuf:"bytes,2,rep,name=oids,proto3" json:"oids,omitempty"` + // the depth of commit + Depth int32 `protobuf:"varint,3,opt,name=depth,proto3" json:"depth,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ReceivePackRequest) Reset() { *m = ReceivePackRequest{} } +func (m *ReceivePackRequest) String() string { return proto.CompactTextString(m) } +func (*ReceivePackRequest) ProtoMessage() {} +func (*ReceivePackRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_server_f3182e3be274f50f, []int{4} +} +func (m *ReceivePackRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ReceivePackRequest.Unmarshal(m, b) +} +func (m *ReceivePackRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ReceivePackRequest.Marshal(b, m, deterministic) +} +func (dst *ReceivePackRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReceivePackRequest.Merge(dst, src) +} +func (m *ReceivePackRequest) XXX_Size() int { + return xxx_messageInfo_ReceivePackRequest.Size(m) +} +func (m *ReceivePackRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ReceivePackRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ReceivePackRequest proto.InternalMessageInfo + +func (m *ReceivePackRequest) GetRepository() *Repository { + if m != nil { + return m.Repository + } + return nil +} + +func (m *ReceivePackRequest) GetOids() []string { + if m != nil { + return m.Oids + } + return nil +} + +func (m *ReceivePackRequest) GetDepth() int32 { + if m != nil { + return m.Depth + } + return 0 +} + +type ReceivePackResponse struct { + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ReceivePackResponse) Reset() { *m = ReceivePackResponse{} } +func (m *ReceivePackResponse) String() string { return proto.CompactTextString(m) } +func (*ReceivePackResponse) ProtoMessage() {} +func (*ReceivePackResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_server_f3182e3be274f50f, []int{5} +} +func (m *ReceivePackResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ReceivePackResponse.Unmarshal(m, b) +} +func (m *ReceivePackResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ReceivePackResponse.Marshal(b, m, deterministic) +} +func (dst *ReceivePackResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReceivePackResponse.Merge(dst, src) +} +func (m *ReceivePackResponse) XXX_Size() int { + return xxx_messageInfo_ReceivePackResponse.Size(m) +} +func (m *ReceivePackResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ReceivePackResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ReceivePackResponse proto.InternalMessageInfo + +func (m *ReceivePackResponse) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + func init() { proto.RegisterType((*ServerInfoRequest)(nil), "gitaly.ServerInfoRequest") proto.RegisterType((*ServerInfoResponse)(nil), "gitaly.ServerInfoResponse") proto.RegisterType((*ServerInfoResponse_StorageStatus)(nil), "gitaly.ServerInfoResponse.StorageStatus") + proto.RegisterType((*GetObjectsRequest)(nil), "gitaly.GetObjectsRequest") + proto.RegisterType((*GetObjectsResponse)(nil), "gitaly.GetObjectsResponse") + proto.RegisterType((*ReceivePackRequest)(nil), "gitaly.ReceivePackRequest") + proto.RegisterType((*ReceivePackResponse)(nil), "gitaly.ReceivePackResponse") } // Reference imports to suppress errors if they are not otherwise used. @@ -180,6 +391,8 @@ 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 ServerServiceClient interface { ServerInfo(ctx context.Context, in *ServerInfoRequest, opts ...grpc.CallOption) (*ServerInfoResponse, error) + GetObjects(ctx context.Context, in *GetObjectsRequest, opts ...grpc.CallOption) (ServerService_GetObjectsClient, error) + ReceivePack(ctx context.Context, in *ReceivePackRequest, opts ...grpc.CallOption) (ServerService_ReceivePackClient, error) } type serverServiceClient struct { @@ -199,9 +412,75 @@ func (c *serverServiceClient) ServerInfo(ctx context.Context, in *ServerInfoRequ return out, nil } +func (c *serverServiceClient) GetObjects(ctx context.Context, in *GetObjectsRequest, opts ...grpc.CallOption) (ServerService_GetObjectsClient, error) { + stream, err := c.cc.NewStream(ctx, &_ServerService_serviceDesc.Streams[0], "/gitaly.ServerService/GetObjects", opts...) + if err != nil { + return nil, err + } + x := &serverServiceGetObjectsClient{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 ServerService_GetObjectsClient interface { + Recv() (*GetObjectsResponse, error) + grpc.ClientStream +} + +type serverServiceGetObjectsClient struct { + grpc.ClientStream +} + +func (x *serverServiceGetObjectsClient) Recv() (*GetObjectsResponse, error) { + m := new(GetObjectsResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *serverServiceClient) ReceivePack(ctx context.Context, in *ReceivePackRequest, opts ...grpc.CallOption) (ServerService_ReceivePackClient, error) { + stream, err := c.cc.NewStream(ctx, &_ServerService_serviceDesc.Streams[1], "/gitaly.ServerService/ReceivePack", opts...) + if err != nil { + return nil, err + } + x := &serverServiceReceivePackClient{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 ServerService_ReceivePackClient interface { + Recv() (*ReceivePackResponse, error) + grpc.ClientStream +} + +type serverServiceReceivePackClient struct { + grpc.ClientStream +} + +func (x *serverServiceReceivePackClient) Recv() (*ReceivePackResponse, error) { + m := new(ReceivePackResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + // ServerServiceServer is the server API for ServerService service. type ServerServiceServer interface { ServerInfo(context.Context, *ServerInfoRequest) (*ServerInfoResponse, error) + GetObjects(*GetObjectsRequest, ServerService_GetObjectsServer) error + ReceivePack(*ReceivePackRequest, ServerService_ReceivePackServer) error } func RegisterServerServiceServer(s *grpc.Server, srv ServerServiceServer) { @@ -226,6 +505,48 @@ func _ServerService_ServerInfo_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _ServerService_GetObjects_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetObjectsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ServerServiceServer).GetObjects(m, &serverServiceGetObjectsServer{stream}) +} + +type ServerService_GetObjectsServer interface { + Send(*GetObjectsResponse) error + grpc.ServerStream +} + +type serverServiceGetObjectsServer struct { + grpc.ServerStream +} + +func (x *serverServiceGetObjectsServer) Send(m *GetObjectsResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _ServerService_ReceivePack_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ReceivePackRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ServerServiceServer).ReceivePack(m, &serverServiceReceivePackServer{stream}) +} + +type ServerService_ReceivePackServer interface { + Send(*ReceivePackResponse) error + grpc.ServerStream +} + +type serverServiceReceivePackServer struct { + grpc.ServerStream +} + +func (x *serverServiceReceivePackServer) Send(m *ReceivePackResponse) error { + return x.ServerStream.SendMsg(m) +} + var _ServerService_serviceDesc = grpc.ServiceDesc{ ServiceName: "gitaly.ServerService", HandlerType: (*ServerServiceServer)(nil), @@ -235,31 +556,54 @@ var _ServerService_serviceDesc = grpc.ServiceDesc{ Handler: _ServerService_ServerInfo_Handler, }, }, - Streams: []grpc.StreamDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "GetObjects", + Handler: _ServerService_GetObjects_Handler, + ServerStreams: true, + }, + { + StreamName: "ReceivePack", + Handler: _ServerService_ReceivePack_Handler, + ServerStreams: true, + }, + }, Metadata: "server.proto", } -func init() { proto.RegisterFile("server.proto", fileDescriptor_server_636aea99a5d9572b) } - -var fileDescriptor_server_636aea99a5d9572b = []byte{ - // 301 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xcf, 0x4a, 0xc3, 0x40, - 0x10, 0xc6, 0x69, 0x0a, 0xa5, 0x9d, 0x26, 0xfe, 0x59, 0x2f, 0x35, 0x08, 0xd6, 0x80, 0x90, 0x4b, - 0x13, 0xa9, 0x6f, 0xe0, 0x4d, 0x04, 0x0f, 0x09, 0x78, 0x10, 0xa1, 0x6c, 0xda, 0x71, 0x5d, 0x48, - 0xb2, 0x71, 0x67, 0x5b, 0xf1, 0x49, 0x3c, 0xfa, 0x9e, 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5d, - 0x66, 0x76, 0xfa, 0xd7, 0x1e, 0xf6, 0x6e, 0xc3, 0xf0, 0xff, 0x15, 0xa3, 0xde, 0xd7, 0x47, 0xec, - 0xf5, 0xbd, 0x9b, 0xab, 0xc7, 0xb5, 0xa8, 0xe4, 0x45, 0x32, 0x57, 0x55, 0xea, 0x7e, 0x27, 0x4a, - 0x8b, 0xd4, 0x59, 0x27, 0xf6, 0xe9, 0x52, 0xa1, 0xda, 0xba, 0x29, 0x8a, 0x9e, 0x45, 0xd7, 0xdf, - 0x01, 0x00, 0x00, 0xff, 0xff, 0x9b, 0xbd, 0xac, 0x8f, 0xf3, 0x01, 0x00, 0x00, +func init() { proto.RegisterFile("server.proto", fileDescriptor_server_f3182e3be274f50f) } + +var fileDescriptor_server_f3182e3be274f50f = []byte{ + // 485 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x95, 0xed, 0x34, 0x4a, 0xc6, 0x49, 0x69, 0xa7, 0x1c, 0x82, 0x41, 0x22, 0x58, 0x02, 0x99, + 0x43, 0x9d, 0x2a, 0xfc, 0x01, 0x17, 0x84, 0x10, 0x50, 0x6d, 0x10, 0x07, 0x38, 0x54, 0x6b, 0x7b, + 0x70, 0x17, 0x92, 0xac, 0xd9, 0xdd, 0x06, 0x85, 0x1f, 0xe1, 0xc8, 0x7f, 0x22, 0x21, 0xa1, 0xec, + 0x3a, 0xb1, 0xdb, 0x94, 0x5b, 0x2f, 0xd1, 0xcc, 0x9b, 0xb7, 0x33, 0xef, 0x8d, 0x27, 0x30, 0xd0, + 0xa4, 0x56, 0xa4, 0xd2, 0x4a, 0x49, 0x23, 0xb1, 0x5b, 0x0a, 0xc3, 0xe7, 0xeb, 0x68, 0xa0, 0x2f, + 0xb9, 0xa2, 0xc2, 0xa1, 0xf1, 0x09, 0x1c, 0xcf, 0x2c, 0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, 0x96, 0x75, 0x2d, 0xf4, 0xe2, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x37, 0x1c, 0x2d, + 0x13, 0x09, 0x04, 0x00, 0x00, } diff --git a/vendor/vendor.json b/vendor/vendor.json index 0a2350787ecb4c03d704e84a84f76c2711c4b2ad..ff755d7c88ecfb3b91c539b350c6aee70d153f42 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -601,12 +601,13 @@ "revisionTime": "2016-03-31T18:18:00Z" }, { - "checksumSHA1": "Zay2Py6C0tGA5s8ZdR50hLOk9cw=", + "checksumSHA1": "g6/Wa5MXw1IevH3BIscia4qMo2Q=", + "origin": "gitlab.com/SeananXu/gitaly-proto/go/gitalypb", "path": "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb", - "revision": "865659a0c99d0663b4d908bdb3f9956a714909ea", - "revisionTime": "2019-05-20T22:20:03Z", - "version": "v1.29.1", - "versionExact": "v1.29.1" + "revision": "a5e9fb4e89d1941d01391981616a1e404a7804b9", + "revisionTime": "2019-05-14T02:57:01Z", + "version": "master", + "versionExact": "master" }, { "checksumSHA1": "WMOuBgCyclqy+Mqunb0NbykaC4Y=",