Skip to content
Snippets Groups Projects
Commit 7bde0f66 authored by Kim "BKC" Carlbäcker's avatar Kim "BKC" Carlbäcker
Browse files

merge conflicts

parents 2f19b043 c7ba74a5
No related branches found
No related tags found
1 merge request!1For-Each-Ref RPC&Messages
Pipeline #
Loading
Loading
@@ -80,3 +80,5 @@ gRPC provides an implementation framework based on these Protobuf concepts.
return meaningful
[errors](https://godoc.org/google.golang.org/grpc/codes#Code) to its
clients.
1. Each RPC `FooBar` has its own `FooBarRequest` and `FooBarResponse`
message types.
Loading
Loading
@@ -2,18 +2,20 @@
require_relative 'run.rb'
 
def main
no_changes_in_protos!
no_changes!
run!(%w[_support/install-protoc])
run!(%w[_support/generate-from-proto])
no_changes_in_protos!
no_changes!
puts 'OK! The gRPC / Protobuf clients are up-to-date'
end
 
def no_changes_in_protos!
changes = capture!(%w[git status --porcelain -- protos]).chomp
if changes.lines.any?
puts changes
abort 'error: detected changes in /protos'
def no_changes!
changes = capture!(%w[git status --porcelain]).chomp.lines
# _support/Gemfile.lock might change due to the CI Bundler version. Ignore all of _support.
changes = changes.reject { |l| l =~ /^.. _support/ }
if changes.any?
run!(%w[git diff])
abort 'error: detected changes'
end
end
 
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
require_relative 'run.rb'
 
PROTO_INCLUDE = '.'
PROTO_FILES = %w[gitaly.proto]
PROTO_FILES = Dir['*.proto'].sort
 
ENV['PATH'] = [
File.join(ENV['GOPATH'], 'bin'),
Loading
Loading
Loading
Loading
@@ -2,13 +2,15 @@ syntax = "proto3";
 
package gitaly;
 
import "shared.proto";
// The Git 'smart HTTP' protocol
service SmartHTTP {
// The response body for GET /info/refs?service=git-upload-pack
rpc InfoRefsUploadPack(InfoRefsRequest) returns (stream InfoRefsResponse) {}
rpc InfoRefsUploadPack(InfoRefsUploadPackRequest) returns (stream InfoRefsUploadPackResponse) {}
 
// The response body for GET /info/refs?service=git-receive-pack
rpc InfoRefsReceivePack(InfoRefsRequest) returns (stream InfoRefsResponse) {}
rpc InfoRefsReceivePack(InfoRefsReceivePackRequest) returns (stream InfoRefsReceivePackResponse) {}
}
 
service Notifications {
Loading
Loading
@@ -16,10 +18,25 @@ service Notifications {
}
 
service Ref {
rpc FindDefaultBranchName(FindDefaultBranchNameRequest) returns (FindDefaultBranchNameResponse) {}
rpc FindAllBranchNames(FindAllBranchNamesRequest) returns (stream FindAllBranchNamesResponse) {}
rpc FindAllTagNames(FindAllTagNamesRequest) returns (stream FindAllTagNamesResponse) {}
// Find a Ref matching the given constraints. Response may be empty.
rpc FindRefName(FindRefNameRequest) returns (FindRefNameResponse) {}
}
 
service Diff {
// Returns stream of CommitDiffResponse: 1 per changed file
rpc CommitDiff(CommitDiffRequest) returns (stream CommitDiffResponse) {};
}
message InfoRefsUploadPackRequest {
Repository repository = 1;
}
message InfoRefsReceivePackRequest {
}
service Commit {
rpc CommitIsAncestor(CommitIsAncestorRequest) returns (CommitIsAncestorResponse) {}
}
Loading
Loading
@@ -32,12 +49,12 @@ message InfoRefsRequest {
Repository repository = 1;
}
 
message InfoRefsResponse {
message InfoRefsUploadPackResponse {
bytes data = 1;
}
 
message Repository {
string path = 1;
message InfoRefsReceivePackResponse {
bytes data = 1;
}
 
message PostReceiveRequest {
Loading
Loading
@@ -64,3 +81,46 @@ message CommitIsAncestorRequest {
string ancestor_id = 2;
string child_id = 3;
}
message FindDefaultBranchNameRequest {
Repository repository = 1;
}
message FindAllBranchNamesRequest {
Repository repository = 1;
}
message FindAllTagNamesRequest {
Repository repository = 1;
}
message FindDefaultBranchNameResponse {
bytes name = 1;
}
message FindAllBranchNamesResponse {
repeated bytes names = 1;
}
message FindAllTagNamesResponse {
repeated bytes names = 1;
}
message CommitDiffRequest {
Repository repository = 1;
string left_commit_id = 2;
string right_commit_id = 3;
}
// A CommitDiffResponse corresponds to a single changed file in a commit.
message CommitDiffResponse {
bytes from_path = 1;
bytes to_path = 2;
// Blob ID as returned via `git diff --full-index`
string from_id = 3;
string to_id = 4;
int32 old_mode = 5;
int32 new_mode = 6;
bool binary = 7;
repeated bytes raw_chunks = 8;
}
This diff is collapsed.
Loading
Loading
@@ -2,28 +2,31 @@ package helper
 
import (
"io"
pb "gitlab.com/gitlab-org/gitaly-proto/go"
)
 
type InfoRefsClient interface {
Recv() (*pb.InfoRefsResponse, error)
type DataGetter interface {
GetData() []byte
}
 
type InfoRefsClientWriterTo struct {
InfoRefsClient
func DataWithError(dg DataGetter, err error) ([]byte, error) {
return dg.GetData(), err
}
 
func (clientReader *InfoRefsClientWriterTo) WriteTo(w io.Writer) (total int64, err error) {
// Example use:
//
// BytesReceiver(func() ([]byte, error) { DataWithError(c.Recv()) }).WriteTo(writer)
type BytesReceiver func() ([]byte, error)
func (br BytesReceiver) WriteTo(w io.Writer) (total int64, err error) {
for {
response, err := clientReader.Recv()
b, err := br()
if err == io.EOF {
return total, nil
} else if err != nil {
return total, err
}
 
n, err := w.Write(response.GetData())
n, err := w.Write(b)
total += int64(n)
if err != nil {
return total, err
Loading
Loading
// Code generated by protoc-gen-go.
// source: shared.proto
// DO NOT EDIT!
package gitaly
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
type Repository struct {
Path string `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"`
}
func (m *Repository) Reset() { *m = Repository{} }
func (m *Repository) String() string { return proto.CompactTextString(m) }
func (*Repository) ProtoMessage() {}
func (*Repository) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} }
func (m *Repository) GetPath() string {
if m != nil {
return m.Path
}
return ""
}
type ExitStatus struct {
Value int32 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
}
func (m *ExitStatus) Reset() { *m = ExitStatus{} }
func (m *ExitStatus) String() string { return proto.CompactTextString(m) }
func (*ExitStatus) ProtoMessage() {}
func (*ExitStatus) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} }
func (m *ExitStatus) GetValue() int32 {
if m != nil {
return m.Value
}
return 0
}
func init() {
proto.RegisterType((*Repository)(nil), "gitaly.Repository")
proto.RegisterType((*ExitStatus)(nil), "gitaly.ExitStatus")
}
func init() { proto.RegisterFile("shared.proto", fileDescriptor1) }
var fileDescriptor1 = []byte{
// 111 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0xce, 0x48, 0x2c,
0x4a, 0x4d, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x4b, 0xcf, 0x2c, 0x49, 0xcc, 0xa9,
0x54, 0x52, 0xe0, 0xe2, 0x0a, 0x4a, 0x2d, 0xc8, 0x2f, 0xce, 0x2c, 0xc9, 0x2f, 0xaa, 0x14, 0x12,
0xe2, 0x62, 0x29, 0x48, 0x2c, 0xc9, 0x90, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x02, 0xb3, 0x95,
0x94, 0xb8, 0xb8, 0x5c, 0x2b, 0x32, 0x4b, 0x82, 0x4b, 0x12, 0x4b, 0x4a, 0x8b, 0x85, 0x44, 0xb8,
0x58, 0xcb, 0x12, 0x73, 0x4a, 0x53, 0xc1, 0x4a, 0x58, 0x83, 0x20, 0x9c, 0x24, 0x36, 0xb0, 0xa1,
0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfd, 0x48, 0xc1, 0x82, 0x64, 0x00, 0x00, 0x00,
}
// Code generated by protoc-gen-go.
// source: ssh.proto
// DO NOT EDIT!
package gitaly
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 SSHUploadPackRequest struct {
// 'repository' must be present in the first message.
Repository *Repository `protobuf:"bytes,1,opt,name=repository" json:"repository,omitempty"`
// A chunk of raw data to be copied to 'git upload-pack' standard input
Stdin []byte `protobuf:"bytes,2,opt,name=stdin,proto3" json:"stdin,omitempty"`
}
func (m *SSHUploadPackRequest) Reset() { *m = SSHUploadPackRequest{} }
func (m *SSHUploadPackRequest) String() string { return proto.CompactTextString(m) }
func (*SSHUploadPackRequest) ProtoMessage() {}
func (*SSHUploadPackRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} }
func (m *SSHUploadPackRequest) GetRepository() *Repository {
if m != nil {
return m.Repository
}
return nil
}
func (m *SSHUploadPackRequest) GetStdin() []byte {
if m != nil {
return m.Stdin
}
return nil
}
type SSHUploadPackResponse struct {
// A chunk of raw data from 'git upload-pack' standard output
Stdout []byte `protobuf:"bytes,1,opt,name=stdout,proto3" json:"stdout,omitempty"`
// A chunk of raw data from 'git upload-pack' standard error
Stderr []byte `protobuf:"bytes,2,opt,name=stderr,proto3" json:"stderr,omitempty"`
// This field may be nil. This is intentional: only when the remote
// command has finished can we return its exit status.
ExitStatus *ExitStatus `protobuf:"bytes,3,opt,name=exit_status,json=exitStatus" json:"exit_status,omitempty"`
}
func (m *SSHUploadPackResponse) Reset() { *m = SSHUploadPackResponse{} }
func (m *SSHUploadPackResponse) String() string { return proto.CompactTextString(m) }
func (*SSHUploadPackResponse) ProtoMessage() {}
func (*SSHUploadPackResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} }
func (m *SSHUploadPackResponse) GetStdout() []byte {
if m != nil {
return m.Stdout
}
return nil
}
func (m *SSHUploadPackResponse) GetStderr() []byte {
if m != nil {
return m.Stderr
}
return nil
}
func (m *SSHUploadPackResponse) GetExitStatus() *ExitStatus {
if m != nil {
return m.ExitStatus
}
return nil
}
type SSHReceivePackRequest struct {
// 'repository' must be present in the first message.
Repository *Repository `protobuf:"bytes,1,opt,name=repository" json:"repository,omitempty"`
// A chunk of raw data to be copied to 'git upload-pack' standard input
Stdin []byte `protobuf:"bytes,2,opt,name=stdin,proto3" json:"stdin,omitempty"`
// Contents of GL_ID environment variable for 'git receive-pack'
GlId string `protobuf:"bytes,3,opt,name=gl_id,json=glId" json:"gl_id,omitempty"`
}
func (m *SSHReceivePackRequest) Reset() { *m = SSHReceivePackRequest{} }
func (m *SSHReceivePackRequest) String() string { return proto.CompactTextString(m) }
func (*SSHReceivePackRequest) ProtoMessage() {}
func (*SSHReceivePackRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} }
func (m *SSHReceivePackRequest) GetRepository() *Repository {
if m != nil {
return m.Repository
}
return nil
}
func (m *SSHReceivePackRequest) GetStdin() []byte {
if m != nil {
return m.Stdin
}
return nil
}
func (m *SSHReceivePackRequest) GetGlId() string {
if m != nil {
return m.GlId
}
return ""
}
type SSHReceivePackResponse struct {
// A chunk of raw data from 'git receive-pack' standard output
Stdout []byte `protobuf:"bytes,1,opt,name=stdout,proto3" json:"stdout,omitempty"`
// A chunk of raw data from 'git receive-pack' standard error
Stderr []byte `protobuf:"bytes,2,opt,name=stderr,proto3" json:"stderr,omitempty"`
// This field may be nil. This is intentional: only when the remote
// command has finished can we return its exit status.
ExitStatus *ExitStatus `protobuf:"bytes,3,opt,name=exit_status,json=exitStatus" json:"exit_status,omitempty"`
}
func (m *SSHReceivePackResponse) Reset() { *m = SSHReceivePackResponse{} }
func (m *SSHReceivePackResponse) String() string { return proto.CompactTextString(m) }
func (*SSHReceivePackResponse) ProtoMessage() {}
func (*SSHReceivePackResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} }
func (m *SSHReceivePackResponse) GetStdout() []byte {
if m != nil {
return m.Stdout
}
return nil
}
func (m *SSHReceivePackResponse) GetStderr() []byte {
if m != nil {
return m.Stderr
}
return nil
}
func (m *SSHReceivePackResponse) GetExitStatus() *ExitStatus {
if m != nil {
return m.ExitStatus
}
return nil
}
func init() {
proto.RegisterType((*SSHUploadPackRequest)(nil), "gitaly.SSHUploadPackRequest")
proto.RegisterType((*SSHUploadPackResponse)(nil), "gitaly.SSHUploadPackResponse")
proto.RegisterType((*SSHReceivePackRequest)(nil), "gitaly.SSHReceivePackRequest")
proto.RegisterType((*SSHReceivePackResponse)(nil), "gitaly.SSHReceivePackResponse")
}
// 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 SSH service
type SSHClient interface {
// To forward 'git upload-pack' to Gitaly for SSH sessions
SSHUploadPack(ctx context.Context, opts ...grpc.CallOption) (SSH_SSHUploadPackClient, error)
// To forward 'git receive-pack' to Gitaly for SSH sessions
SSHReceivePack(ctx context.Context, opts ...grpc.CallOption) (SSH_SSHReceivePackClient, error)
}
type sSHClient struct {
cc *grpc.ClientConn
}
func NewSSHClient(cc *grpc.ClientConn) SSHClient {
return &sSHClient{cc}
}
func (c *sSHClient) SSHUploadPack(ctx context.Context, opts ...grpc.CallOption) (SSH_SSHUploadPackClient, error) {
stream, err := grpc.NewClientStream(ctx, &_SSH_serviceDesc.Streams[0], c.cc, "/gitaly.SSH/SSHUploadPack", opts...)
if err != nil {
return nil, err
}
x := &sSHSSHUploadPackClient{stream}
return x, nil
}
type SSH_SSHUploadPackClient interface {
Send(*SSHUploadPackRequest) error
Recv() (*SSHUploadPackResponse, error)
grpc.ClientStream
}
type sSHSSHUploadPackClient struct {
grpc.ClientStream
}
func (x *sSHSSHUploadPackClient) Send(m *SSHUploadPackRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *sSHSSHUploadPackClient) Recv() (*SSHUploadPackResponse, error) {
m := new(SSHUploadPackResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *sSHClient) SSHReceivePack(ctx context.Context, opts ...grpc.CallOption) (SSH_SSHReceivePackClient, error) {
stream, err := grpc.NewClientStream(ctx, &_SSH_serviceDesc.Streams[1], c.cc, "/gitaly.SSH/SSHReceivePack", opts...)
if err != nil {
return nil, err
}
x := &sSHSSHReceivePackClient{stream}
return x, nil
}
type SSH_SSHReceivePackClient interface {
Send(*SSHReceivePackRequest) error
Recv() (*SSHReceivePackResponse, error)
grpc.ClientStream
}
type sSHSSHReceivePackClient struct {
grpc.ClientStream
}
func (x *sSHSSHReceivePackClient) Send(m *SSHReceivePackRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *sSHSSHReceivePackClient) Recv() (*SSHReceivePackResponse, error) {
m := new(SSHReceivePackResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// Server API for SSH service
type SSHServer interface {
// To forward 'git upload-pack' to Gitaly for SSH sessions
SSHUploadPack(SSH_SSHUploadPackServer) error
// To forward 'git receive-pack' to Gitaly for SSH sessions
SSHReceivePack(SSH_SSHReceivePackServer) error
}
func RegisterSSHServer(s *grpc.Server, srv SSHServer) {
s.RegisterService(&_SSH_serviceDesc, srv)
}
func _SSH_SSHUploadPack_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(SSHServer).SSHUploadPack(&sSHSSHUploadPackServer{stream})
}
type SSH_SSHUploadPackServer interface {
Send(*SSHUploadPackResponse) error
Recv() (*SSHUploadPackRequest, error)
grpc.ServerStream
}
type sSHSSHUploadPackServer struct {
grpc.ServerStream
}
func (x *sSHSSHUploadPackServer) Send(m *SSHUploadPackResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *sSHSSHUploadPackServer) Recv() (*SSHUploadPackRequest, error) {
m := new(SSHUploadPackRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func _SSH_SSHReceivePack_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(SSHServer).SSHReceivePack(&sSHSSHReceivePackServer{stream})
}
type SSH_SSHReceivePackServer interface {
Send(*SSHReceivePackResponse) error
Recv() (*SSHReceivePackRequest, error)
grpc.ServerStream
}
type sSHSSHReceivePackServer struct {
grpc.ServerStream
}
func (x *sSHSSHReceivePackServer) Send(m *SSHReceivePackResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *sSHSSHReceivePackServer) Recv() (*SSHReceivePackRequest, error) {
m := new(SSHReceivePackRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
var _SSH_serviceDesc = grpc.ServiceDesc{
ServiceName: "gitaly.SSH",
HandlerType: (*SSHServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "SSHUploadPack",
Handler: _SSH_SSHUploadPack_Handler,
ServerStreams: true,
ClientStreams: true,
},
{
StreamName: "SSHReceivePack",
Handler: _SSH_SSHReceivePack_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "ssh.proto",
}
func init() { proto.RegisterFile("ssh.proto", fileDescriptor2) }
var fileDescriptor2 = []byte{
// 284 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xbc, 0x52, 0xcd, 0x4a, 0xc3, 0x40,
0x10, 0x76, 0xad, 0x0d, 0x74, 0x1a, 0x3d, 0xac, 0xb5, 0x84, 0xa0, 0x52, 0x72, 0xca, 0x29, 0x48,
0xfa, 0x0c, 0x42, 0xbd, 0xc9, 0x86, 0x9e, 0x6b, 0xec, 0x2e, 0xe9, 0x62, 0xe8, 0xc6, 0x9d, 0x49,
0x69, 0x41, 0xdf, 0xc9, 0x47, 0x14, 0x92, 0x58, 0x92, 0x6a, 0x8f, 0xf6, 0xb6, 0x33, 0xdf, 0xce,
0xf7, 0x33, 0xbb, 0x30, 0x40, 0x5c, 0x45, 0x85, 0x35, 0x64, 0xb8, 0x93, 0x69, 0x4a, 0xf3, 0x9d,
0xef, 0xe2, 0x2a, 0xb5, 0x4a, 0xd6, 0xdd, 0xe0, 0x05, 0x46, 0x49, 0x32, 0x9b, 0x17, 0xb9, 0x49,
0xe5, 0x73, 0xba, 0x7c, 0x13, 0xea, 0xbd, 0x54, 0x48, 0x3c, 0x06, 0xb0, 0xaa, 0x30, 0xa8, 0xc9,
0xd8, 0x9d, 0xc7, 0x26, 0x2c, 0x1c, 0xc6, 0x3c, 0xaa, 0x29, 0x22, 0xb1, 0x47, 0x44, 0xeb, 0x16,
0x1f, 0x41, 0x1f, 0x49, 0xea, 0xb5, 0x77, 0x3e, 0x61, 0xa1, 0x2b, 0xea, 0x22, 0xf8, 0x80, 0x9b,
0x03, 0x05, 0x2c, 0xcc, 0x1a, 0x15, 0x1f, 0x83, 0x83, 0x24, 0x4d, 0x49, 0x15, 0xbd, 0x2b, 0x9a,
0xaa, 0xe9, 0x2b, 0x6b, 0x1b, 0x9e, 0xa6, 0xe2, 0x53, 0x18, 0xaa, 0xad, 0xa6, 0x05, 0x52, 0x4a,
0x25, 0x7a, 0xbd, 0xae, 0xa7, 0xc7, 0xad, 0xa6, 0xa4, 0x42, 0x04, 0xa8, 0xfd, 0x39, 0xd8, 0x54,
0xea, 0x42, 0x2d, 0x95, 0xde, 0xa8, 0x7f, 0x09, 0xc8, 0xaf, 0xa1, 0x9f, 0xe5, 0x0b, 0x2d, 0x2b,
0x47, 0x03, 0x71, 0x91, 0xe5, 0x4f, 0x32, 0xf8, 0x84, 0xf1, 0xa1, 0xee, 0x09, 0x63, 0xc7, 0x5f,
0x0c, 0x7a, 0x49, 0x32, 0xe3, 0x02, 0x2e, 0x3b, 0xcb, 0xe7, 0xb7, 0x3f, 0x83, 0x7f, 0xbd, 0xba,
0x7f, 0x77, 0x04, 0xad, 0xad, 0x07, 0x67, 0x21, 0x7b, 0x60, 0x7c, 0x0e, 0x57, 0xdd, 0x68, 0xbc,
0x3d, 0xf6, 0x7b, 0xd5, 0xfe, 0xfd, 0x31, 0xb8, 0x4d, 0xfb, 0xea, 0x54, 0x1f, 0x72, 0xfa, 0x1d,
0x00, 0x00, 0xff, 0xff, 0x71, 0xde, 0xae, 0x4f, 0xb3, 0x02, 0x00, 0x00,
}
Loading
Loading
@@ -3,18 +3,24 @@
 
require 'google/protobuf'
 
require 'shared_pb'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "gitaly.InfoRefsUploadPackRequest" do
optional :repository, :message, 1, "gitaly.Repository"
end
add_message "gitaly.InfoRefsReceivePackRequest" do
end
add_message "gitaly.CommitIsAncestorResponse" do
optional :value, :bool, 1
end
add_message "gitaly.InfoRefsRequest" do
optional :repository, :message, 1, "gitaly.Repository"
end
add_message "gitaly.InfoRefsResponse" do
add_message "gitaly.InfoRefsUploadPackResponse" do
optional :data, :bytes, 1
end
add_message "gitaly.Repository" do
optional :path, :string, 1
add_message "gitaly.InfoRefsReceivePackResponse" do
optional :data, :bytes, 1
end
add_message "gitaly.PostReceiveRequest" do
optional :repository, :message, 1, "gitaly.Repository"
Loading
Loading
@@ -34,16 +40,59 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :ancestor_id, :string, 2
optional :child_id, :string, 3
end
add_message "gitaly.FindDefaultBranchNameRequest" do
optional :repository, :message, 1, "gitaly.Repository"
end
add_message "gitaly.FindAllBranchNamesRequest" do
optional :repository, :message, 1, "gitaly.Repository"
end
add_message "gitaly.FindAllTagNamesRequest" do
optional :repository, :message, 1, "gitaly.Repository"
end
add_message "gitaly.FindDefaultBranchNameResponse" do
optional :name, :bytes, 1
end
add_message "gitaly.FindAllBranchNamesResponse" do
repeated :names, :bytes, 1
end
add_message "gitaly.FindAllTagNamesResponse" do
repeated :names, :bytes, 1
end
add_message "gitaly.CommitDiffRequest" do
optional :repository, :message, 1, "gitaly.Repository"
optional :left_commit_id, :string, 2
optional :right_commit_id, :string, 3
end
add_message "gitaly.CommitDiffResponse" do
optional :from_path, :bytes, 1
optional :to_path, :bytes, 2
optional :from_id, :string, 3
optional :to_id, :string, 4
optional :old_mode, :int32, 5
optional :new_mode, :int32, 6
optional :binary, :bool, 7
repeated :raw_chunks, :bytes, 8
end
end
 
module Gitaly
InfoRefsUploadPackRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.InfoRefsUploadPackRequest").msgclass
InfoRefsReceivePackRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.InfoRefsReceivePackRequest").msgclass
CommitIsAncestorResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.CommitIsAncestorResponse").msgclass
InfoRefsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.InfoRefsRequest").msgclass
InfoRefsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.InfoRefsResponse").msgclass
Repository = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.Repository").msgclass
InfoRefsUploadPackResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.InfoRefsUploadPackResponse").msgclass
InfoRefsReceivePackResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.InfoRefsReceivePackResponse").msgclass
PostReceiveRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.PostReceiveRequest").msgclass
PostReceiveResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.PostReceiveResponse").msgclass
FindRefNameRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.FindRefNameRequest").msgclass
FindRefNameResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.FindRefNameResponse").msgclass
CommitIsAncestorRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.CommitIsAncestorRequest").msgclass
FindDefaultBranchNameRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.FindDefaultBranchNameRequest").msgclass
FindAllBranchNamesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.FindAllBranchNamesRequest").msgclass
FindAllTagNamesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.FindAllTagNamesRequest").msgclass
FindDefaultBranchNameResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.FindDefaultBranchNameResponse").msgclass
FindAllBranchNamesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.FindAllBranchNamesResponse").msgclass
FindAllTagNamesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.FindAllTagNamesResponse").msgclass
CommitDiffRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.CommitDiffRequest").msgclass
CommitDiffResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.CommitDiffResponse").msgclass
end
Loading
Loading
@@ -16,9 +16,9 @@ module Gitaly
self.service_name = 'gitaly.SmartHTTP'
 
# The response body for GET /info/refs?service=git-upload-pack
rpc :InfoRefsUploadPack, InfoRefsRequest, stream(InfoRefsResponse)
rpc :InfoRefsUploadPack, InfoRefsUploadPackRequest, stream(InfoRefsUploadPackResponse)
# The response body for GET /info/refs?service=git-receive-pack
rpc :InfoRefsReceivePack, InfoRefsRequest, stream(InfoRefsResponse)
rpc :InfoRefsReceivePack, InfoRefsReceivePackRequest, stream(InfoRefsReceivePackResponse)
end
 
Stub = Service.rpc_stub_class
Loading
Loading
@@ -46,12 +46,30 @@ module Gitaly
self.unmarshal_class_method = :decode
self.service_name = 'gitaly.Ref'
 
rpc :FindDefaultBranchName, FindDefaultBranchNameRequest, FindDefaultBranchNameResponse
rpc :FindAllBranchNames, FindAllBranchNamesRequest, stream(FindAllBranchNamesResponse)
rpc :FindAllTagNames, FindAllTagNamesRequest, stream(FindAllTagNamesResponse)
# Find a Ref matching the given constraints. Response may be empty.
rpc :FindRefName, FindRefNameRequest, FindRefNameResponse
end
 
Stub = Service.rpc_stub_class
end
module Diff
class Service
include GRPC::GenericService
self.marshal_class_method = :encode
self.unmarshal_class_method = :decode
self.service_name = 'gitaly.Diff'
# Returns stream of CommitDiffResponse: 1 per changed file
rpc :CommitDiff, CommitDiffRequest, stream(CommitDiffResponse)
end
Stub = Service.rpc_stub_class
end
module Commit
class Service
 
Loading
Loading
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: shared.proto
require 'google/protobuf'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "gitaly.Repository" do
optional :path, :string, 1
end
add_message "gitaly.ExitStatus" do
optional :value, :int32, 1
end
end
module Gitaly
Repository = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.Repository").msgclass
ExitStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.ExitStatus").msgclass
end
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: ssh.proto
require 'google/protobuf'
require 'shared_pb'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "gitaly.SSHUploadPackRequest" do
optional :repository, :message, 1, "gitaly.Repository"
optional :stdin, :bytes, 2
end
add_message "gitaly.SSHUploadPackResponse" do
optional :stdout, :bytes, 1
optional :stderr, :bytes, 2
optional :exit_status, :message, 3, "gitaly.ExitStatus"
end
add_message "gitaly.SSHReceivePackRequest" do
optional :repository, :message, 1, "gitaly.Repository"
optional :stdin, :bytes, 2
optional :gl_id, :string, 3
end
add_message "gitaly.SSHReceivePackResponse" do
optional :stdout, :bytes, 1
optional :stderr, :bytes, 2
optional :exit_status, :message, 3, "gitaly.ExitStatus"
end
end
module Gitaly
SSHUploadPackRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.SSHUploadPackRequest").msgclass
SSHUploadPackResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.SSHUploadPackResponse").msgclass
SSHReceivePackRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.SSHReceivePackRequest").msgclass
SSHReceivePackResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.SSHReceivePackResponse").msgclass
end
# Generated by the protocol buffer compiler. DO NOT EDIT!
# Source: ssh.proto for package 'gitaly'
require 'grpc'
require 'ssh_pb'
module Gitaly
module SSH
class Service
include GRPC::GenericService
self.marshal_class_method = :encode
self.unmarshal_class_method = :decode
self.service_name = 'gitaly.SSH'
# To forward 'git upload-pack' to Gitaly for SSH sessions
rpc :SSHUploadPack, stream(SSHUploadPackRequest), stream(SSHUploadPackResponse)
# To forward 'git receive-pack' to Gitaly for SSH sessions
rpc :SSHReceivePack, stream(SSHReceivePackRequest), stream(SSHReceivePackResponse)
end
Stub = Service.rpc_stub_class
end
end
syntax = "proto3";
package gitaly;
message Repository {
string path = 1;
}
message ExitStatus {
int32 value = 1;
}
syntax = "proto3";
package gitaly;
import "shared.proto";
service SSH {
// To forward 'git upload-pack' to Gitaly for SSH sessions
rpc SSHUploadPack(stream SSHUploadPackRequest) returns (stream SSHUploadPackResponse) {}
// To forward 'git receive-pack' to Gitaly for SSH sessions
rpc SSHReceivePack(stream SSHReceivePackRequest) returns (stream SSHReceivePackResponse) {}
}
message SSHUploadPackRequest {
// 'repository' must be present in the first message.
Repository repository = 1;
// A chunk of raw data to be copied to 'git upload-pack' standard input
bytes stdin = 2;
}
message SSHUploadPackResponse {
// A chunk of raw data from 'git upload-pack' standard output
bytes stdout = 1;
// A chunk of raw data from 'git upload-pack' standard error
bytes stderr = 2;
// This field may be nil. This is intentional: only when the remote
// command has finished can we return its exit status.
ExitStatus exit_status = 3;
}
message SSHReceivePackRequest {
// 'repository' must be present in the first message.
Repository repository = 1;
// A chunk of raw data to be copied to 'git upload-pack' standard input
bytes stdin = 2;
// Contents of GL_ID environment variable for 'git receive-pack'
string gl_id = 3;
}
message SSHReceivePackResponse {
// A chunk of raw data from 'git receive-pack' standard output
bytes stdout = 1;
// A chunk of raw data from 'git receive-pack' standard error
bytes stderr = 2;
// This field may be nil. This is intentional: only when the remote
// command has finished can we return its exit status.
ExitStatus exit_status = 3;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment