Commit b4f589d1 authored by Zeger-Jan van de Weg's avatar Zeger-Jan van de Weg

Revert "Merge branch 'zj-rename-gitalypb' into 'master'"

This reverts merge request !262
parent 0662bdd1
......@@ -14,5 +14,5 @@ To update e.g. `gitaly-proto` run the following command in the root
directory of the project.
```
support/go-update-vendor gitlab.com/gitlab-org/gitaly-proto/go/gitalypb@v1.3.0
support/go-update-vendor gitlab.com/gitlab-org/gitaly-proto/go@v0.109.0
```
......@@ -5,9 +5,10 @@ import (
"fmt"
"os"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/handler"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/logger"
pb "gitlab.com/gitlab-org/gitaly-proto/go"
)
func init() {
......@@ -23,7 +24,7 @@ func main() {
logger.Fatal("wrong number of arguments", fmt.Errorf("expected 2 arguments, got %v", os.Args))
}
var request gitalypb.SSHReceivePackRequest
var request pb.SSHReceivePackRequest
if err := json.Unmarshal([]byte(os.Args[2]), &request); err != nil {
logger.Fatal("unmarshaling request json failed", err)
}
......
......@@ -5,16 +5,17 @@ import (
"fmt"
"os"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/handler"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/logger"
pb "gitlab.com/gitlab-org/gitaly-proto/go"
)
func init() {
logger.ProgName = "gitaly-upload-archive"
}
type uploadArchiveHandler func(gitalyAddress string, request *gitalypb.SSHUploadArchiveRequest) (int32, error)
type uploadArchiveHandler func(gitalyAddress string, request *pb.SSHUploadArchiveRequest) (int32, error)
func main() {
if err := handler.Prepare(); err != nil {
......@@ -35,7 +36,7 @@ func uploadArchive(handler uploadArchiveHandler, args []string) (int32, error) {
return 0, fmt.Errorf("wrong number of arguments: expected 2 arguments, got %v", args)
}
var request gitalypb.SSHUploadArchiveRequest
var request pb.SSHUploadArchiveRequest
if err := json.Unmarshal([]byte(args[2]), &request); err != nil {
return 0, fmt.Errorf("unmarshaling request json failed: %v", err)
}
......
......@@ -5,7 +5,7 @@ import (
"strings"
"testing"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
pb "gitlab.com/gitlab-org/gitaly-proto/go"
)
var testGitalyAddress = "unix:gitaly.socket"
......@@ -13,7 +13,7 @@ var testGitalyAddress = "unix:gitaly.socket"
func TestUploadArchiveSuccess(t *testing.T) {
testRelativePath := "myrepo.git"
requestJSON := fmt.Sprintf(`{"repository":{"relative_path":"%s"}}`, testRelativePath)
mockHandler := func(gitalyAddress string, request *gitalypb.SSHUploadArchiveRequest) (int32, error) {
mockHandler := func(gitalyAddress string, request *pb.SSHUploadArchiveRequest) (int32, error) {
if gitalyAddress != testGitalyAddress {
t.Fatalf("Expected gitaly address %s got %v", testGitalyAddress, gitalyAddress)
}
......@@ -35,7 +35,7 @@ func TestUploadArchiveSuccess(t *testing.T) {
}
func TestUploadArchiveFailure(t *testing.T) {
mockHandler := func(_ string, _ *gitalypb.SSHUploadArchiveRequest) (int32, error) {
mockHandler := func(_ string, _ *pb.SSHUploadArchiveRequest) (int32, error) {
t.Fatal("Expected handler not to be called")
return 0, nil
......
......@@ -5,9 +5,10 @@ import (
"fmt"
"os"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/handler"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/logger"
pb "gitlab.com/gitlab-org/gitaly-proto/go"
)
func init() {
......@@ -23,7 +24,7 @@ func main() {
logger.Fatal("wrong number of arguments", fmt.Errorf("expected 2 arguments, got %v", os.Args))
}
var request gitalypb.SSHUploadPackRequest
var request pb.SSHUploadPackRequest
if err := json.Unmarshal([]byte(os.Args[2]), &request); err != nil {
logger.Fatal("unmarshaling request json failed", err)
}
......
......@@ -5,11 +5,11 @@ import (
"fmt"
"os"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
pb "gitlab.com/gitlab-org/gitaly-proto/go"
"gitlab.com/gitlab-org/gitaly/client"
)
func ReceivePack(gitalyAddress string, request *gitalypb.SSHReceivePackRequest) (int32, error) {
func ReceivePack(gitalyAddress string, request *pb.SSHReceivePackRequest) (int32, error) {
if gitalyAddress == "" {
return 0, fmt.Errorf("no gitaly_address given")
}
......
......@@ -5,11 +5,11 @@ import (
"fmt"
"os"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
pb "gitlab.com/gitlab-org/gitaly-proto/go"
"gitlab.com/gitlab-org/gitaly/client"
)
func UploadArchive(gitalyAddress string, request *gitalypb.SSHUploadArchiveRequest) (int32, error) {
func UploadArchive(gitalyAddress string, request *pb.SSHUploadArchiveRequest) (int32, error) {
if gitalyAddress == "" {
return 0, fmt.Errorf("no gitaly_address given")
}
......
......@@ -5,11 +5,11 @@ import (
"fmt"
"os"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
pb "gitlab.com/gitlab-org/gitaly-proto/go"
"gitlab.com/gitlab-org/gitaly/client"
)
func UploadPack(gitalyAddress string, request *gitalypb.SSHUploadPackRequest) (int32, error) {
func UploadPack(gitalyAddress string, request *pb.SSHUploadPackRequest) (int32, error) {
if gitalyAddress == "" {
return 0, fmt.Errorf("no gitaly_address given")
}
......
......@@ -2,17 +2,16 @@
// source: blob.proto
/*
Package gitalypb is a generated protocol buffer package.
Package gitaly is a generated protocol buffer package.
It is generated from these files:
blob.proto
cleanup.proto
commit.proto
conflicts.proto
deprecated-services.proto
diff.proto
namespace.proto
notifications.proto
objectpool.proto
operations.proto
ref.proto
remote.proto
......@@ -37,8 +36,6 @@ It has these top-level messages:
GetNewLFSPointersResponse
GetAllLFSPointersRequest
GetAllLFSPointersResponse
ApplyBfgObjectMapRequest
ApplyBfgObjectMapResponse
CommitStatsRequest
CommitStatsResponse
CommitIsAncestorRequest
......@@ -68,8 +65,6 @@ It has these top-level messages:
RawBlameResponse
LastCommitForPathRequest
LastCommitForPathResponse
ListLastCommitsForTreeRequest
ListLastCommitsForTreeResponse
CommitsByMessageRequest
CommitsByMessageResponse
FilterShasWithSignaturesRequest
......@@ -111,15 +106,6 @@ It has these top-level messages:
RenameNamespaceResponse
PostReceiveRequest
PostReceiveResponse
ObjectPool
CreateObjectPoolRequest
CreateObjectPoolResponse
DeleteObjectPoolRequest
DeleteObjectPoolResponse
LinkRepositoryToObjectPoolRequest
LinkRepositoryToObjectPoolResponse
UnlinkRepositoryFromObjectPoolRequest
UnlinkRepositoryFromObjectPoolResponse
UserCreateBranchRequest
UserCreateBranchResponse
UserUpdateBranchRequest
......@@ -148,10 +134,6 @@ It has these top-level messages:
UserRebaseResponse
UserSquashRequest
UserSquashResponse
UserApplyPatchRequest
UserApplyPatchResponse
UserUpdateSubmoduleRequest
UserUpdateSubmoduleResponse
ListNewBlobsRequest
ListNewBlobsResponse
FindDefaultBranchNameRequest
......@@ -200,8 +182,6 @@ It has these top-level messages:
UpdateRemoteMirrorResponse
FindRemoteRepositoryRequest
FindRemoteRepositoryResponse
FindRemoteRootRefRequest
FindRemoteRootRefResponse
RepositoryExistsRequest
RepositoryExistsResponse
RepackIncrementalRequest
......@@ -291,8 +271,6 @@ It has these top-level messages:
SSHReceivePackResponse
SSHUploadArchiveRequest
SSHUploadArchiveResponse
ListDirectoriesRequest
ListDirectoriesResponse
DeleteAllRepositoriesRequest
DeleteAllRepositoriesResponse
WikiCommitDetails
......@@ -315,7 +293,7 @@ It has these top-level messages:
WikiGetFormattedDataRequest
WikiGetFormattedDataResponse
*/
package gitalypb
package gitaly
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
......
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: conflicts.proto
package gitalypb
package gitaly
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
......@@ -26,7 +26,7 @@ type ListConflictFilesRequest struct {
func (m *ListConflictFilesRequest) Reset() { *m = ListConflictFilesRequest{} }
func (m *ListConflictFilesRequest) String() string { return proto.CompactTextString(m) }
func (*ListConflictFilesRequest) ProtoMessage() {}
func (*ListConflictFilesRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} }
func (*ListConflictFilesRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} }
func (m *ListConflictFilesRequest) GetRepository() *Repository {
if m != nil {
......@@ -60,7 +60,7 @@ type ConflictFileHeader struct {
func (m *ConflictFileHeader) Reset() { *m = ConflictFileHeader{} }
func (m *ConflictFileHeader) String() string { return proto.CompactTextString(m) }
func (*ConflictFileHeader) ProtoMessage() {}
func (*ConflictFileHeader) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} }
func (*ConflictFileHeader) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} }
func (m *ConflictFileHeader) GetRepository() *Repository {
if m != nil {
......@@ -107,7 +107,7 @@ type ConflictFile struct {
func (m *ConflictFile) Reset() { *m = ConflictFile{} }
func (m *ConflictFile) String() string { return proto.CompactTextString(m) }
func (*ConflictFile) ProtoMessage() {}
func (*ConflictFile) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{2} }
func (*ConflictFile) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} }
type isConflictFile_ConflictFilePayload interface{ isConflictFile_ConflictFilePayload() }
......@@ -219,7 +219,7 @@ type ListConflictFilesResponse struct {
func (m *ListConflictFilesResponse) Reset() { *m = ListConflictFilesResponse{} }
func (m *ListConflictFilesResponse) String() string { return proto.CompactTextString(m) }
func (*ListConflictFilesResponse) ProtoMessage() {}
func (*ListConflictFilesResponse) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{3} }
func (*ListConflictFilesResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} }
func (m *ListConflictFilesResponse) GetFiles() []*ConflictFile {
if m != nil {
......@@ -242,7 +242,7 @@ type ResolveConflictsRequestHeader struct {
func (m *ResolveConflictsRequestHeader) Reset() { *m = ResolveConflictsRequestHeader{} }
func (m *ResolveConflictsRequestHeader) String() string { return proto.CompactTextString(m) }
func (*ResolveConflictsRequestHeader) ProtoMessage() {}
func (*ResolveConflictsRequestHeader) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{4} }
func (*ResolveConflictsRequestHeader) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{4} }
func (m *ResolveConflictsRequestHeader) GetRepository() *Repository {
if m != nil {
......@@ -310,7 +310,7 @@ type ResolveConflictsRequest struct {
func (m *ResolveConflictsRequest) Reset() { *m = ResolveConflictsRequest{} }
func (m *ResolveConflictsRequest) String() string { return proto.CompactTextString(m) }
func (*ResolveConflictsRequest) ProtoMessage() {}
func (*ResolveConflictsRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{5} }
func (*ResolveConflictsRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{5} }
type isResolveConflictsRequest_ResolveConflictsRequestPayload interface{ isResolveConflictsRequest_ResolveConflictsRequestPayload() }
......@@ -422,7 +422,7 @@ type ResolveConflictsResponse struct {
func (m *ResolveConflictsResponse) Reset() { *m = ResolveConflictsResponse{} }
func (m *ResolveConflictsResponse) String() string { return proto.CompactTextString(m) }
func (*ResolveConflictsResponse) ProtoMessage() {}
func (*ResolveConflictsResponse) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{6} }
func (*ResolveConflictsResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{6} }
func (m *ResolveConflictsResponse) GetResolutionError() string {
if m != nil {
......@@ -607,9 +607,9 @@ var _ConflictsService_serviceDesc = grpc.ServiceDesc{
Metadata: "conflicts.proto",
}
func init() { proto.RegisterFile("conflicts.proto", fileDescriptor3) }
func init() { proto.RegisterFile("conflicts.proto", fileDescriptor2) }
var fileDescriptor3 = []byte{
var fileDescriptor2 = []byte{
// 575 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0xd1, 0x6a, 0x13, 0x41,
0x14, 0x86, 0xbb, 0x6d, 0x93, 0x34, 0xa7, 0xdb, 0x34, 0x1d, 0x94, 0x6e, 0x03, 0xa1, 0xdb, 0xad,
......
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: cleanup.proto
package gitalypb
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
type ApplyBfgObjectMapRequest struct {
Repository *Repository `protobuf:"bytes,1,opt,name=repository" json:"repository,omitempty"`
// A raw object-map file as generated by BFG: https://rtyley.github.io/bfg-repo-cleaner
// Each line in the file has two object SHAs, space-separated - the original
// SHA of the object, and the SHA after BFG has rewritten the object.
ObjectMap []byte `protobuf:"bytes,2,opt,name=object_map,json=objectMap,proto3" json:"object_map,omitempty"`
}
func (m *ApplyBfgObjectMapRequest) Reset() { *m = ApplyBfgObjectMapRequest{} }
func (m *ApplyBfgObjectMapRequest) String() string { return proto.CompactTextString(m) }
func (*ApplyBfgObjectMapRequest) ProtoMessage() {}
func (*ApplyBfgObjectMapRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} }
func (m *ApplyBfgObjectMapRequest) GetRepository() *Repository {
if m != nil {
return m.Repository
}
return nil
}
func (m *ApplyBfgObjectMapRequest) GetObjectMap() []byte {
if m != nil {
return m.ObjectMap
}
return nil
}
type ApplyBfgObjectMapResponse struct {
}
func (m *ApplyBfgObjectMapResponse) Reset() { *m = ApplyBfgObjectMapResponse{} }
func (m *ApplyBfgObjectMapResponse) String() string { return proto.CompactTextString(m) }
func (*ApplyBfgObjectMapResponse) ProtoMessage() {}
func (*ApplyBfgObjectMapResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} }
func init() {
proto.RegisterType((*ApplyBfgObjectMapRequest)(nil), "gitaly.ApplyBfgObjectMapRequest")
proto.RegisterType((*ApplyBfgObjectMapResponse)(nil), "gitaly.ApplyBfgObjectMapResponse")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// Client API for CleanupService service
type CleanupServiceClient interface {
ApplyBfgObjectMap(ctx context.Context, opts ...grpc.CallOption) (CleanupService_ApplyBfgObjectMapClient, error)
}
type cleanupServiceClient struct {
cc *grpc.ClientConn
}
func NewCleanupServiceClient(cc *grpc.ClientConn) CleanupServiceClient {
return &cleanupServiceClient{cc}
}
func (c *cleanupServiceClient) ApplyBfgObjectMap(ctx context.Context, opts ...grpc.CallOption) (CleanupService_ApplyBfgObjectMapClient, error) {
stream, err := grpc.NewClientStream(ctx, &_CleanupService_serviceDesc.Streams[0], c.cc, "/gitaly.CleanupService/ApplyBfgObjectMap", opts...)
if err != nil {
return nil, err
}
x := &cleanupServiceApplyBfgObjectMapClient{stream}
return x, nil
}
type CleanupService_ApplyBfgObjectMapClient interface {
Send(*ApplyBfgObjectMapRequest) error
CloseAndRecv() (*ApplyBfgObjectMapResponse, error)
grpc.ClientStream
}
type cleanupServiceApplyBfgObjectMapClient struct {
grpc.ClientStream
}
func (x *cleanupServiceApplyBfgObjectMapClient) Send(m *ApplyBfgObjectMapRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *cleanupServiceApplyBfgObjectMapClient) CloseAndRecv() (*ApplyBfgObjectMapResponse, error) {
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
m := new(ApplyBfgObjectMapResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// Server API for CleanupService service
type CleanupServiceServer interface {
ApplyBfgObjectMap(CleanupService_ApplyBfgObjectMapServer) error
}
func RegisterCleanupServiceServer(s *grpc.Server, srv CleanupServiceServer) {
s.RegisterService(&_CleanupService_serviceDesc, srv)
}
func _CleanupService_ApplyBfgObjectMap_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(CleanupServiceServer).ApplyBfgObjectMap(&cleanupServiceApplyBfgObjectMapServer{stream})
}
type CleanupService_ApplyBfgObjectMapServer interface {
SendAndClose(*ApplyBfgObjectMapResponse) error
Recv() (*ApplyBfgObjectMapRequest, error)
grpc.ServerStream
}
type cleanupServiceApplyBfgObjectMapServer struct {
grpc.ServerStream
}
func (x *cleanupServiceApplyBfgObjectMapServer) SendAndClose(m *ApplyBfgObjectMapResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *cleanupServiceApplyBfgObjectMapServer) Recv() (*ApplyBfgObjectMapRequest, error) {
m := new(ApplyBfgObjectMapRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
var _CleanupService_serviceDesc = grpc.ServiceDesc{
ServiceName: "gitaly.CleanupService",
HandlerType: (*CleanupServiceServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "ApplyBfgObjectMap",
Handler: _CleanupService_ApplyBfgObjectMap_Handler,
ClientStreams: true,
},
},
Metadata: "cleanup.proto",
}
func init() { proto.RegisterFile("cleanup.proto", fileDescriptor1) }
var fileDescriptor1 = []byte{
// 195 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4d, 0xce, 0x49, 0x4d,
0xcc, 0x2b, 0x2d, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x4b, 0xcf, 0x2c, 0x49, 0xcc,
0xa9, 0x94, 0xe2, 0x29, 0xce, 0x48, 0x2c, 0x4a, 0x4d, 0x81, 0x88, 0x2a, 0xe5, 0x72, 0x49, 0x38,
0x16, 0x14, 0xe4, 0x54, 0x3a, 0xa5, 0xa5, 0xfb, 0x27, 0x65, 0xa5, 0x26, 0x97, 0xf8, 0x26, 0x16,
0x04, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x08, 0x19, 0x71, 0x71, 0x15, 0xa5, 0x16, 0xe4, 0x17,
0x67, 0x96, 0xe4, 0x17, 0x55, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x1b, 0x09, 0xe9, 0x41, 0x8c,
0xd1, 0x0b, 0x82, 0xcb, 0x04, 0x21, 0xa9, 0x12, 0x92, 0xe5, 0xe2, 0xca, 0x07, 0x9b, 0x13, 0x9f,
0x9b, 0x58, 0x20, 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0x13, 0xc4, 0x99, 0x0f, 0x33, 0x59, 0x49, 0x9a,
0x4b, 0x12, 0x8b, 0x75, 0xc5, 0x05, 0xf9, 0x79, 0xc5, 0xa9, 0x46, 0x79, 0x5c, 0x7c, 0xce, 0x10,
0x27, 0x07, 0xa7, 0x16, 0x95, 0x65, 0x26, 0xa7, 0x0a, 0xc5, 0x70, 0x09, 0x62, 0x28, 0x17, 0x52,
0x80, 0x39, 0x01, 0x97, 0xc3, 0xa5, 0x14, 0xf1, 0xa8, 0x80, 0xd8, 0xa5, 0xc4, 0xa0, 0xc1, 0x98,
0xc4, 0x06, 0x0e, 0x02, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9b, 0x2a, 0x94, 0xb4, 0x29,
0x01, 0x00, 0x00,
}
package helper
import (
"io"
pb "gitlab.com/gitlab-org/gitaly-proto/go"
)
type InfoRefsClient interface {
Recv() (*pb.InfoRefsResponse, error)
}
type InfoRefsClientWriterTo struct {
InfoRefsClient
}
func (clientReader *InfoRefsClientWriterTo) WriteTo(w io.Writer) (total int64, err error) {
for {
response, err := clientReader.Recv()
if err == io.EOF {
return total, nil
} else if err != nil {
return total, err
}
n, err := w.Write(response.GetData())
total += int64(n)
if err != nil {
return total, err
}
}
}
package helper
import (
"io"
)
// NewReceiveReader turns receiver into an io.Reader. Errors from the
// receiver function are passed on unmodified. This means receiver should
// emit io.EOF when done.
func NewReceiveReader(receiver func() ([]byte, error)) io.Reader {
return &receiveReader{receiver: receiver}
}
type receiveReader struct {
receiver func() ([]byte, error)
data []byte
err error
}
func (rr *receiveReader) Read(p []byte) (int, error) {
if len(rr.data) == 0 {
rr.data, rr.err = rr.receiver()
}
n := copy(p, rr.data)
rr.data = rr.data[n:]
if len(rr.data) == 0 {
return n, rr.err
}
return n, nil
}
// NewSendWriter turns sender into an io.Writer. The number of 'bytes
// written' reported back is always len(p).
func NewSendWriter(sender func(p []byte) error) io.Writer {
return &sendWriter{sender: sender}
}
type sendWriter struct {
sender func([]byte) error
}
func (sw *sendWriter) Write(p []byte) (int, error) {
return len(p), sw.sender(p)
}
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: namespace.proto
package gitalypb
package gitaly
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
......
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: notifications.proto
package gitalypb
package gitaly
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
......
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: server.proto
package gitalypb
package gitaly
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
......@@ -23,7 +23,7 @@ type ServerInfoRequest struct {
func (m *ServerInfoRequest) Reset() { *m = ServerInfoRequest{} }
func (m *ServerInfoRequest) String() string { return proto.CompactTextString(m) }
func (*ServerInfoRequest) ProtoMessage() {}
func (*ServerInfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor12, []int{0} }
func (*ServerInfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{0} }
type ServerInfoResponse struct {
ServerVersion string `protobuf:"bytes,1,opt,name=server_version,json=serverVersion" json:"server_version,omitempty"`
......@@ -34,7 +34,7 @@ type ServerInfoResponse struct {
func (m *ServerInfoResponse) Reset() { *m = ServerInfoResponse{} }
func (m *ServerInfoResponse) String() string { return proto.CompactTextString(m) }
func (*ServerInfoResponse) ProtoMessage() {}
func (*ServerInfoResponse) Descriptor() ([]byte, []int) { return fileDescriptor12, []int{1} }
func (*ServerInfoResponse) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{1} }
func (m *ServerInfoResponse) GetServerVersion() string {
if m != nil {
......@@ -67,7 +67,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 fileDescriptor12, []int{1, 0}
return fileDescriptor11, []int{1, 0}
}
func (m *ServerInfoResponse_StorageStatus) GetStorageName() string {
......@@ -169,9 +169,9 @@ var _ServerService_serviceDesc = grpc.ServiceDesc{
Metadata: "server.proto",
}
func init() { proto.RegisterFile("server.proto", fileDescriptor12) }
func init() { proto.RegisterFile("server.proto", fileDescriptor11) }
var fileDescriptor12 = []byte{
var fileDescriptor11 = []byte{
// 258 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xcf, 0x4a, 0xc3, 0x40,
0x10, 0xc6, 0x6d, 0x03, 0xa5, 0x9d, 0x34, 0xfe, 0x19, 0x2f, 0x35, 0x08, 0xd6, 0x80, 0x90, 0x53,
......
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: smarthttp.proto
package gitalypb
package gitaly
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
......@@ -28,7 +28,7 @@ type InfoRefsRequest struct {
func (m *InfoRefsRequest) Reset() { *m = InfoRefsRequest{} }
func (m *InfoRefsRequest) String() string { return proto.CompactTextString(m) }
func (*InfoRefsRequest) ProtoMessage() {}
func (*InfoRefsRequest) Descriptor() ([]byte, []int) { return fileDescriptor14, []int{0} }
func (*InfoRefsRequest) Descriptor() ([]byte, []int) { return fileDescriptor13, []int{0} }
func (m *InfoRefsRequest) GetRepository() *Repository {
if m != nil {
......@@ -58,7 +58,7 @@ type InfoRefsResponse struct {
func (m *InfoRefsResponse) Reset() { *m = InfoRefsResponse{} }
func (m *InfoRefsResponse) String() string { return proto.CompactTextString(m) }
func (*InfoRefsResponse) ProtoMessage() {}
func (*InfoRefsResponse) Descriptor() ([]byte, []int) { return fileDescriptor14, []int{1} }
func (*InfoRefsResponse) Descriptor() ([]byte, []int) { return fileDescriptor13, []int{1} }
func (m *InfoRefsResponse) GetData() []byte {
if m != nil {
......@@ -81,7 +81,7 @@ type PostUploadPackRequest struct {
func (m *PostUploadPackRequest) Reset() { *m = PostUploadPackRequest{} }
func (m *PostUploadPackRequest) String() string { return proto.CompactTextString(m) }
func (*PostUploadPackRequest) ProtoMessage() {}
func (*PostUploadPackRequest) Descriptor() ([]byte, []int) { return fileDescriptor14, []int{2} }
func (*PostUploadPackRequest) Descriptor() ([]byte, []int) { return fileDescriptor13, []int{2} }
func (m *PostUploadPackRequest) GetRepository() *Repository {
if m != nil {
......@@ -119,7 +119,7 @@ type PostUploadPackResponse struct {
func (m *PostUploadPackResponse) Reset() { *m = PostUploadPackResponse{} }
func (m *PostUploadPackResponse) String() string { return proto.CompactTextString(m) }
func (*PostUploadPackResponse) ProtoMessage() {}
func (*PostUploadPackResponse) Descriptor() ([]byte, []int) { return fileDescriptor14, []int{3} }
func (*PostUploadPackResponse) Descriptor() ([]byte, []int) { return fileDescriptor13, []int{3} }
func (m *PostUploadPackResponse) GetData() []byte {
if m != nil {
......@@ -147,7 +147,7 @@ type PostReceivePackRequest struct {
func (m *PostReceivePackRequest) Reset() { *m = PostReceivePackRequest{} }
func (m *PostReceivePackRequest) String() string { return proto.CompactTextString(m) }
func (*PostReceivePackRequest) ProtoMessage() {}
func (*PostReceivePackRequest) Descriptor() ([]byte, []int) { return fileDescriptor14, []int{4} }
func (*PostReceivePackRequest) Descriptor() ([]byte, []int) { return fileDescriptor13, []int{4} }
func (m *PostReceivePackRequest) GetRepository() *Repository {
if m != nil {
......@@ -206,7 +206,7 @@ type PostReceivePackResponse struct {
func (m *PostReceivePackResponse) Reset() { *m = PostReceivePackResponse{} }
func (m *PostReceivePackResponse) String() string { return proto.CompactTextString(m) }
func (*PostReceivePackResponse) ProtoMessage() {}
func (*PostReceivePackResponse) Descriptor() ([]byte, []int) { return fileDescriptor14, []int{5} }
func (*PostReceivePackResponse) Descriptor() ([]byte, []int) { return fileDescriptor13, []int{5} }
func (m *PostReceivePackResponse) GetData() []byte {
if m != nil {
......@@ -521,9 +521,9 @@ var _SmartHTTPService_serviceDesc = grpc.ServiceDesc{
Metadata: "smarthttp.proto",
}
func init() { proto.RegisterFile("smarthttp.proto", fileDescriptor14) }
func init() { proto.RegisterFile("smarthttp.proto", fileDescriptor13) }
var fileDescriptor14 = []byte{
var fileDescriptor13 = []byte{
// 423 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0xd1, 0x8a, 0xd3, 0x40,
0x14, 0x75, 0xd2, 0x6e, 0x65, 0x6f, 0xa3, 0x2d, 0x77, 0xd1, 0x0d, 0x01, 0xdd, 0x1a, 0x41, 0xf2,
......
package client
import (
"fmt"
"net/url"
)
func parseAddress(rawAddress string) (canonicalAddress string, err error) {
u, err := url.Parse(rawAddress)
if err != nil {
return "", err
}
// tcp:// addresses are a special case which `grpc.Dial` expects in a
// different format
if u.Scheme == "tcp" || u.Scheme == "tls" {
if u.Path != "" {
return "", fmt.Errorf("%s addresses should not have a path", u.Scheme)
}
return u.Host, nil
}
return u.String(), nil
}
// +build !darwin
package client
import "crypto/x509"
// systemCertPool has an override on macOS.
func systemCertPool() (*x509.CertPool, error) { return x509.SystemCertPool() }
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment