Commit 9f4a72a4 authored by Nick Thomas's avatar Nick Thomas

Merge branch '149-show-all-refs' into 'master'

Respect the ShowAllRefs flag in git upload-pack and info-refs

Closes #149

See merge request gitlab-org/gitlab-workhorse!203
parents 2ee8ec83 ba8d951b
...@@ -15,6 +15,7 @@ import ( ...@@ -15,6 +15,7 @@ import (
"time" "time"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api" "gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/git"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/gitaly" "gitlab.com/gitlab-org/gitlab-workhorse/internal/gitaly"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper" "gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
...@@ -60,17 +61,29 @@ func TestGetInfoRefsProxiedToGitalySuccessfully(t *testing.T) { ...@@ -60,17 +61,29 @@ func TestGetInfoRefsProxiedToGitalySuccessfully(t *testing.T) {
apiResponse := gitOkBody(t) apiResponse := gitOkBody(t)
apiResponse.GitalyServer.Address = gitalyAddress apiResponse.GitalyServer.Address = gitalyAddress
ts := testAuthServer(nil, 200, apiResponse) for _, showAllRefs := range []bool{true, false} {
defer ts.Close() t.Run(fmt.Sprintf("ShowAllRefs=%v", showAllRefs), func(t *testing.T) {
apiResponse.ShowAllRefs = showAllRefs
ws := startWorkhorseServer(ts.URL) ts := testAuthServer(nil, 200, apiResponse)
defer ws.Close() defer ts.Close()
resource := "/gitlab-org/gitlab-test.git/info/refs?service=git-upload-pack" ws := startWorkhorseServer(ts.URL)
_, body := httpGet(t, ws.URL+resource) defer ws.Close()
resource := "/gitlab-org/gitlab-test.git/info/refs?service=git-upload-pack"
_, body := httpGet(t, ws.URL+resource)
expectedContent := "\n\000" + string(testhelper.GitalyInfoRefsResponseMock) + "\000"
if showAllRefs {
expectedContent = git.GitConfigShowAllRefs + expectedContent
}
assert.Equal(t, expectedContent, body, "GET %q: response body", resource)
})
}
expectedContent := string(testhelper.GitalyInfoRefsResponseMock)
assert.Equal(t, expectedContent, body, "GET %q: response body", resource)
} }
func TestGetInfoRefsProxiedToGitalyInterruptedStream(t *testing.T) { func TestGetInfoRefsProxiedToGitalyInterruptedStream(t *testing.T) {
...@@ -182,11 +195,20 @@ func TestPostReceivePackProxiedToGitalyInterrupted(t *testing.T) { ...@@ -182,11 +195,20 @@ func TestPostReceivePackProxiedToGitalyInterrupted(t *testing.T) {
} }
func TestPostUploadPackProxiedToGitalySuccessfully(t *testing.T) { func TestPostUploadPackProxiedToGitalySuccessfully(t *testing.T) {
apiResponse := gitOkBody(t) for i, tc := range []struct {
showAllRefs bool
for _, code := range []codes.Code{codes.OK, codes.Unavailable} { code codes.Code
func() { }{
gitalyServer, socketPath := startGitalyServer(t, code) {true, codes.OK},
{true, codes.Unavailable},
{false, codes.OK},
{false, codes.Unavailable},
} {
t.Run(fmt.Sprintf("Case %d", i), func(t *testing.T) {
apiResponse := gitOkBody(t)
apiResponse.ShowAllRefs = tc.showAllRefs
gitalyServer, socketPath := startGitalyServer(t, tc.code)
defer gitalyServer.Stop() defer gitalyServer.Stop()
apiResponse.GitalyServer.Address = "unix://" + socketPath apiResponse.GitalyServer.Address = "unix://" + socketPath
...@@ -204,16 +226,23 @@ func TestPostUploadPackProxiedToGitalySuccessfully(t *testing.T) { ...@@ -204,16 +226,23 @@ func TestPostUploadPackProxiedToGitalySuccessfully(t *testing.T) {
testhelper.GitalyUploadPackResponseMock, testhelper.GitalyUploadPackResponseMock,
) )
expectedBody := strings.Join([]string{ expectedBodyParts := []string{
apiResponse.Repository.StorageName, apiResponse.Repository.StorageName,
apiResponse.Repository.RelativePath, apiResponse.Repository.RelativePath,
string(testhelper.GitalyUploadPackResponseMock), }
}, "\000") if tc.showAllRefs {
expectedBodyParts = append(expectedBodyParts, git.GitConfigShowAllRefs+"\n")
} else {
expectedBodyParts = append(expectedBodyParts, "\n")
}
expectedBodyParts = append(expectedBodyParts, string(testhelper.GitalyUploadPackResponseMock))
expectedBody := strings.Join(expectedBodyParts, "\000")
assert.Equal(t, 200, resp.StatusCode, "POST %q", resource) assert.Equal(t, 200, resp.StatusCode, "POST %q", resource)
assert.Equal(t, expectedBody, body, "POST %q: response body", resource) assert.Equal(t, expectedBody, body, "POST %q: response body", resource)
testhelper.AssertResponseHeader(t, resp, "Content-Type", "application/x-git-upload-pack-result") testhelper.AssertResponseHeader(t, resp, "Content-Type", "application/x-git-upload-pack-result")
}() })
} }
} }
......
...@@ -114,6 +114,8 @@ type Response struct { ...@@ -114,6 +114,8 @@ type Response struct {
// Repository object for making gRPC requests to Gitaly. This will // Repository object for making gRPC requests to Gitaly. This will
// eventually replace the RepoPath field. // eventually replace the RepoPath field.
Repository pb.Repository Repository pb.Repository
// For git-http, does the requestor have the right to view all refs?
ShowAllRefs bool
} }
// singleJoiningSlash is taken from reverseproxy.go:NewSingleHostReverseProxy // singleJoiningSlash is taken from reverseproxy.go:NewSingleHostReverseProxy
......
...@@ -20,6 +20,12 @@ import ( ...@@ -20,6 +20,12 @@ import (
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper" "gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
) )
const (
// We have to use a negative transfer.hideRefs since this is the only way
// to undo an already set parameter: https://www.spinics.net/lists/git/msg256772.html
GitConfigShowAllRefs = "transfer.hideRefs=!refs"
)
func ReceivePack(a *api.API) http.Handler { func ReceivePack(a *api.API) http.Handler {
return postRPCHandler(a, "handleReceivePack", handleReceivePack) return postRPCHandler(a, "handleReceivePack", handleReceivePack)
} }
...@@ -28,6 +34,16 @@ func UploadPack(a *api.API) http.Handler { ...@@ -28,6 +34,16 @@ func UploadPack(a *api.API) http.Handler {
return postRPCHandler(a, "handleUploadPack", handleUploadPack) return postRPCHandler(a, "handleUploadPack", handleUploadPack)
} }
func gitConfigOptions(a *api.Response) []string {
var out []string
if a.ShowAllRefs {
out = append(out, GitConfigShowAllRefs)
}
return out
}
func postRPCHandler(a *api.API, name string, handler func(*GitHttpResponseWriter, *http.Request, *api.Response) error) http.Handler { func postRPCHandler(a *api.API, name string, handler func(*GitHttpResponseWriter, *http.Request, *api.Response) error) http.Handler {
return repoPreAuthorizeHandler(a, func(rw http.ResponseWriter, r *http.Request, ar *api.Response) { return repoPreAuthorizeHandler(a, func(rw http.ResponseWriter, r *http.Request, ar *api.Response) {
cr := &countReadCloser{ReadCloser: r.Body} cr := &countReadCloser{ReadCloser: r.Body}
......
...@@ -77,7 +77,7 @@ func handleGetInfoRefsWithGitaly(ctx context.Context, w http.ResponseWriter, a * ...@@ -77,7 +77,7 @@ func handleGetInfoRefsWithGitaly(ctx context.Context, w http.ResponseWriter, a *
return fmt.Errorf("GetInfoRefsHandler: %v", err) return fmt.Errorf("GetInfoRefsHandler: %v", err)
} }
infoRefsResponseReader, err := smarthttp.InfoRefsResponseReader(ctx, &a.Repository, rpc) infoRefsResponseReader, err := smarthttp.InfoRefsResponseReader(ctx, &a.Repository, rpc, gitConfigOptions(a))
if err != nil { if err != nil {
return fmt.Errorf("GetInfoRefsHandler: %v", err) return fmt.Errorf("GetInfoRefsHandler: %v", err)
} }
......
...@@ -65,7 +65,7 @@ func handleUploadPackWithGitaly(ctx context.Context, a *api.Response, clientRequ ...@@ -65,7 +65,7 @@ func handleUploadPackWithGitaly(ctx context.Context, a *api.Response, clientRequ
return fmt.Errorf("smarthttp.UploadPack: %v", err) return fmt.Errorf("smarthttp.UploadPack: %v", err)
} }
if err := smarthttp.UploadPack(ctx, &a.Repository, clientRequest, clientResponse); err != nil { if err := smarthttp.UploadPack(ctx, &a.Repository, clientRequest, clientResponse, gitConfigOptions(a)); err != nil {
return fmt.Errorf("smarthttp.UploadPack: %v", err) return fmt.Errorf("smarthttp.UploadPack: %v", err)
} }
......
...@@ -13,8 +13,8 @@ type SmartHTTPClient struct { ...@@ -13,8 +13,8 @@ type SmartHTTPClient struct {
pb.SmartHTTPServiceClient pb.SmartHTTPServiceClient
} }
func (client *SmartHTTPClient) InfoRefsResponseReader(ctx context.Context, repo *pb.Repository, rpc string) (io.Reader, error) { func (client *SmartHTTPClient) InfoRefsResponseReader(ctx context.Context, repo *pb.Repository, rpc string, gitConfigOptions []string) (io.Reader, error) {
rpcRequest := &pb.InfoRefsRequest{Repository: repo} rpcRequest := &pb.InfoRefsRequest{Repository: repo, GitConfigOptions: gitConfigOptions}
switch rpc { switch rpc {
case "git-upload-pack": case "git-upload-pack":
...@@ -86,14 +86,15 @@ func (client *SmartHTTPClient) ReceivePack(ctx context.Context, repo *pb.Reposit ...@@ -86,14 +86,15 @@ func (client *SmartHTTPClient) ReceivePack(ctx context.Context, repo *pb.Reposit
return nil return nil
} }
func (client *SmartHTTPClient) UploadPack(ctx context.Context, repo *pb.Repository, clientRequest io.Reader, clientResponse io.Writer) error { func (client *SmartHTTPClient) UploadPack(ctx context.Context, repo *pb.Repository, clientRequest io.Reader, clientResponse io.Writer, gitConfigOptions []string) error {
stream, err := client.PostUploadPack(ctx) stream, err := client.PostUploadPack(ctx)
if err != nil { if err != nil {
return err return err
} }
rpcRequest := &pb.PostUploadPackRequest{ rpcRequest := &pb.PostUploadPackRequest{
Repository: repo, Repository: repo,
GitConfigOptions: gitConfigOptions,
} }
if err := stream.Send(rpcRequest); err != nil { if err := stream.Send(rpcRequest); err != nil {
......
...@@ -53,7 +53,14 @@ func (s *GitalyTestServer) InfoRefsUploadPack(in *pb.InfoRefsRequest, stream pb. ...@@ -53,7 +53,14 @@ func (s *GitalyTestServer) InfoRefsUploadPack(in *pb.InfoRefsRequest, stream pb.
return err return err
} }
nSends, err := sendBytes([]byte(GitalyInfoRefsResponseMock), 100, func(p []byte) error { fmt.Printf("Result: %+v", in)
data := []byte(strings.Join([]string{
strings.Join(in.GitConfigOptions, "\n") + "\n",
GitalyInfoRefsResponseMock,
}, "\000") + "\000")
nSends, err := sendBytes(data, 100, func(p []byte) error {
return stream.Send(&pb.InfoRefsResponse{Data: p}) return stream.Send(&pb.InfoRefsResponse{Data: p})
}) })
if err != nil { if err != nil {
...@@ -147,6 +154,7 @@ func (s *GitalyTestServer) PostUploadPack(stream pb.SmartHTTPService_PostUploadP ...@@ -147,6 +154,7 @@ func (s *GitalyTestServer) PostUploadPack(stream pb.SmartHTTPService_PostUploadP
data := []byte(strings.Join([]string{ data := []byte(strings.Join([]string{
repo.GetStorageName(), repo.GetStorageName(),
repo.GetRelativePath(), repo.GetRelativePath(),
strings.Join(req.GitConfigOptions, "\n") + "\n",
}, "\000") + "\000") }, "\000") + "\000")
// The body of the request starts in the second message // The body of the request starts in the second message
...@@ -307,6 +315,10 @@ func (s *GitalyTestServer) Exists(context.Context, *pb.RepositoryExistsRequest) ...@@ -307,6 +315,10 @@ func (s *GitalyTestServer) Exists(context.Context, *pb.RepositoryExistsRequest)
return nil, nil return nil, nil
} }
func (s *GitalyTestServer) HasLocalBranches(ctx context.Context, in *pb.HasLocalBranchesRequest) (*pb.HasLocalBranchesResponse, error) {
return nil, nil
}
func (s *GitalyTestServer) CommitDelta(in *pb.CommitDeltaRequest, stream pb.DiffService_CommitDeltaServer) error { func (s *GitalyTestServer) CommitDelta(in *pb.CommitDeltaRequest, stream pb.DiffService_CommitDeltaServer) error {
return nil return nil
} }
...@@ -319,6 +331,10 @@ func (s *GitalyTestServer) CommitPatch(in *pb.CommitPatchRequest, stream pb.Diff ...@@ -319,6 +331,10 @@ func (s *GitalyTestServer) CommitPatch(in *pb.CommitPatchRequest, stream pb.Diff
return nil return nil
} }
func (s *GitalyTestServer) GetBlobs(in *pb.GetBlobsRequest, stream pb.BlobService_GetBlobsServer) error {
return nil
}
// sendBytes returns the number of times the 'sender' function was called and an error. // sendBytes returns the number of times the 'sender' function was called and an error.
func sendBytes(data []byte, chunkSize int, sender func([]byte) error) (int, error) { func sendBytes(data []byte, chunkSize int, sender func([]byte) error) (int, error) {
i := 0 i := 0
......
...@@ -19,6 +19,8 @@ var _ = math.Inf ...@@ -19,6 +19,8 @@ var _ = math.Inf
type InfoRefsRequest struct { type InfoRefsRequest struct {
Repository *Repository `protobuf:"bytes,1,opt,name=repository" json:"repository,omitempty"` Repository *Repository `protobuf:"bytes,1,opt,name=repository" json:"repository,omitempty"`
// Parameters to use with git -c (key=value pairs)
GitConfigOptions []string `protobuf:"bytes,2,rep,name=git_config_options,json=gitConfigOptions" json:"git_config_options,omitempty"`
} }
func (m *InfoRefsRequest) Reset() { *m = InfoRefsRequest{} } func (m *InfoRefsRequest) Reset() { *m = InfoRefsRequest{} }
...@@ -33,6 +35,13 @@ func (m *InfoRefsRequest) GetRepository() *Repository { ...@@ -33,6 +35,13 @@ func (m *InfoRefsRequest) GetRepository() *Repository {
return nil return nil
} }
func (m *InfoRefsRequest) GetGitConfigOptions() []string {
if m != nil {
return m.GitConfigOptions
}
return nil
}
type InfoRefsResponse struct { type InfoRefsResponse struct {
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
} }
...@@ -54,6 +63,8 @@ type PostUploadPackRequest struct { ...@@ -54,6 +63,8 @@ type PostUploadPackRequest struct {
Repository *Repository `protobuf:"bytes,1,opt,name=repository" json:"repository,omitempty"` Repository *Repository `protobuf:"bytes,1,opt,name=repository" json:"repository,omitempty"`
// Raw data to be copied to stdin of 'git upload-pack' // Raw data to be copied to stdin of 'git upload-pack'
Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
// Parameters to use with git -c (key=value pairs)
GitConfigOptions []string `protobuf:"bytes,3,rep,name=git_config_options,json=gitConfigOptions" json:"git_config_options,omitempty"`
} }
func (m *PostUploadPackRequest) Reset() { *m = PostUploadPackRequest{} } func (m *PostUploadPackRequest) Reset() { *m = PostUploadPackRequest{} }
...@@ -75,6 +86,13 @@ func (m *PostUploadPackRequest) GetData() []byte { ...@@ -75,6 +86,13 @@ func (m *PostUploadPackRequest) GetData() []byte {
return nil return nil
} }
func (m *PostUploadPackRequest) GetGitConfigOptions() []string {
if m != nil {
return m.GitConfigOptions
}
return nil
}
type PostUploadPackResponse struct { type PostUploadPackResponse struct {
// Raw data from stdout of 'git upload-pack' // Raw data from stdout of 'git upload-pack'
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
...@@ -470,27 +488,30 @@ var _SmartHTTPService_serviceDesc = grpc.ServiceDesc{ ...@@ -470,27 +488,30 @@ var _SmartHTTPService_serviceDesc = grpc.ServiceDesc{
func init() { proto.RegisterFile("smarthttp.proto", fileDescriptor10) } func init() { proto.RegisterFile("smarthttp.proto", fileDescriptor10) }
var fileDescriptor10 = []byte{ var fileDescriptor10 = []byte{
// 346 bytes of a gzipped FileDescriptorProto // 386 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0xd1, 0x4e, 0xc2, 0x30, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x93, 0xdd, 0xee, 0xd2, 0x40,
0x14, 0x75, 0x08, 0x24, 0x5e, 0x50, 0xc8, 0x25, 0xca, 0xb2, 0x44, 0x21, 0x33, 0x31, 0x3c, 0x28, 0x10, 0xc5, 0x5d, 0xbe, 0x12, 0x06, 0x14, 0x32, 0x44, 0x69, 0x9a, 0x28, 0xa4, 0x26, 0xa6, 0x17,
0x21, 0xf8, 0x0d, 0x26, 0x12, 0x7d, 0x20, 0x05, 0x12, 0xdf, 0x96, 0xca, 0x4a, 0x59, 0x2c, 0x74, 0x48, 0x08, 0x3e, 0x82, 0x37, 0x12, 0x4d, 0x24, 0x0b, 0x24, 0xde, 0x35, 0x6b, 0xbb, 0x2c, 0x1b,
0xb6, 0x85, 0x84, 0x6f, 0xf3, 0x5f, 0xfc, 0x16, 0xe3, 0xe6, 0xd8, 0x00, 0xf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, 0x01, 0x06, 0x65, 0xfd, 0x0c, 0xf5, 0xaf, 0x6e, 0x1b, 0x78, 0x72, 0x3d, 0x4a,
0xff, 0xff, 0x58, 0x82, 0x47, 0x22, 0x7b, 0x03, 0x00, 0x00, 0x7c, 0x5e, 0xf4, 0xff, 0x71, 0xe3, 0xdc, 0x17, 0x55, 0x72, 0x61, 0xea, 0x93, 0x19, 0xc1, 0x4f,
0xd0, 0xbb, 0x79, 0x35, 0xbc, 0x3a, 0x78, 0xbf, 0x0b, 0xee, 0xa8, 0x52, 0xbf, 0x74, 0xfe, 0xdc,
0xca, 0xfe, 0xd7, 0x37, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xaf, 0x85, 0x01, 0x06, 0xd8, 0x03,
0x00, 0x00,
} }
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: wiki.proto
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 WikiPageVersion struct {
Commit *GitCommit `protobuf:"bytes,1,opt,name=commit" json:"commit,omitempty"`
Format string `protobuf:"bytes,2,opt,name=format" json:"format,omitempty"`
}
func (m *WikiPageVersion) Reset() { *m = WikiPageVersion{} }
func (m *WikiPageVersion) String() string { return proto.CompactTextString(m) }
func (*WikiPageVersion) ProtoMessage() {}
func (*WikiPageVersion) Descriptor() ([]byte, []int) { return fileDescriptor12, []int{0} }
func (m *WikiPageVersion) GetCommit() *GitCommit {
if m != nil {
return m.Commit
}
return nil
}
func (m *WikiPageVersion) GetFormat() string {
if m != nil {
return m.Format
}
return ""
}
type WikiGetPageVersionsRequest struct {
Repository *Repository `protobuf:"bytes,1,opt,name=repository" json:"repository,omitempty"`
PagePath []byte `protobuf:"bytes,2,opt,name=page_path,json=pagePath,proto3" json:"page_path,omitempty"`
}
func (m *WikiGetPageVersionsRequest) Reset() { *m = WikiGetPageVersionsRequest{} }
func (m *WikiGetPageVersionsRequest) String() string { return proto.CompactTextString(m) }
func (*WikiGetPageVersionsRequest) ProtoMessage() {}
func (*WikiGetPageVersionsRequest) Descriptor() ([]byte, []int) { return fileDescriptor12, []int{1} }
func (m *WikiGetPageVersionsRequest) GetRepository() *Repository {
if m != nil {
return m.Repository
}
return nil
}
func (m *WikiGetPageVersionsRequest) GetPagePath() []byte {
if m != nil {
return m.PagePath
}
return nil
}
type WikiGetPageVersionsResponse struct {
Versions []*WikiPageVersion `protobuf:"bytes,1,rep,name=versions" json:"versions,omitempty"`
}
func (m *WikiGetPageVersionsResponse) Reset() { *m = WikiGetPageVersionsResponse{} }
func (m *WikiGetPageVersionsResponse) String() string { return proto.CompactTextString(m) }
func (*WikiGetPageVersionsResponse) ProtoMessage() {}
func (*WikiGetPageVersionsResponse) Descriptor() ([]byte, []int) { return fileDescriptor12, []int{2} }
func (m *WikiGetPageVersionsResponse) GetVersions() []*WikiPageVersion {
if m != nil {
return m.Versions
}
return nil
}
func init() {
proto.RegisterType((*WikiPageVersion)(nil), "gitaly.WikiPageVersion")
proto.RegisterType((*WikiGetPageVersionsRequest)(nil), "gitaly.WikiGetPageVersionsRequest")
proto.RegisterType((*WikiGetPageVersionsResponse)(nil), "gitaly.WikiGetPageVersionsResponse")
}
// 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 WikiService service
type WikiServiceClient interface {
WikiGetPageVersions(ctx context.Context, in *WikiGetPageVersionsRequest, opts ...grpc.CallOption) (WikiService_WikiGetPageVersionsClient, error)
}
type wikiServiceClient struct {
cc *grpc.ClientConn
}
func NewWikiServiceClient(cc *grpc.ClientConn) WikiServiceClient {
return &wikiServiceClient{cc}
}
func (c *wikiServiceClient) WikiGetPageVersions(ctx context.Context, in *WikiGetPageVersionsRequest, opts ...grpc.CallOption) (WikiService_WikiGetPageVersionsClient, error) {
stream, err := grpc.NewClientStream(ctx, &_WikiService_serviceDesc.Streams[0], c.cc, "/gitaly.WikiService/WikiGetPageVersions", opts...)
if err != nil {
return nil, err
}
x := &wikiServiceWikiGetPageVersionsClient{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 WikiService_WikiGetPageVersionsClient interface {
Recv() (*WikiGetPageVersionsResponse, error)
grpc.ClientStream
}
type wikiServiceWikiGetPageVersionsClient struct {
grpc.ClientStream
}
func (x *wikiServiceWikiGetPageVersionsClient) Recv() (*WikiGetPageVersionsResponse, error) {
m := new(WikiGetPageVersionsResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// Server API for WikiService service
type WikiServiceServer interface {
WikiGetPageVersions(*WikiGetPageVersionsRequest, WikiService_WikiGetPageVersionsServer) error
}
func RegisterWikiServiceServer(s *grpc.Server, srv WikiServiceServer) {
s.RegisterService(&_WikiService_serviceDesc, srv)
}
func _WikiService_WikiGetPageVersions_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(WikiGetPageVersionsRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(WikiServiceServer).WikiGetPageVersions(m, &wikiServiceWikiGetPageVersionsServer{stream})
}
type WikiService_WikiGetPageVersionsServer interface {
Send(*WikiGetPageVersionsResponse) error
grpc.ServerStream
}
type wikiServiceWikiGetPageVersionsServer struct {
grpc.ServerStream
}
func (x *wikiServiceWikiGetPageVersionsServer) Send(m *WikiGetPageVersionsResponse) error {
return x.ServerStream.SendMsg(m)
}
var _WikiService_serviceDesc = grpc.ServiceDesc{
ServiceName: "gitaly.WikiService",
HandlerType: (*WikiServiceServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "WikiGetPageVersions",
Handler: _WikiService_WikiGetPageVersions_Handler,
ServerStreams: true,
},
},
Metadata: "wiki.proto",
}
func init() { proto.RegisterFile("wiki.proto", fileDescriptor12) }
var fileDescriptor12 = []byte{
// 258 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xcf, 0x4a, 0xf3, 0x40,
0x14, 0xc5, 0xbf, 0x7c, 0x42, 0x68, 0x6f, 0x0a, 0xe2, 0x08, 0x1a, 0xd2, 0x4d, 0x18, 0x37, 0x71,
0x13, 0x24, 0x7d, 0x04, 0x17, 0xdd, 0x96, 0x51, 0x74, 0x29, 0xd3, 0x7a, 0x4d, 0x2e, 0x35, 0x9d,
0xe9, 0xcc, 0xb5, 0xd2, 0xb7, 0x97, 0xfc, 0x69, 0x09, 0x12, 0x5c, 0xce, 0x39, 0x67, 0xce, 0x6f,
0x0e, 0x03, 0xf0, 0x4d, 0x5b, 0xca, 0xad, 0x33, 0x6c, 0x44, 0x58, 0x12, 0xeb, 0xcf, 0x63, 0x32,
0xf3, 0x95, 0x76, 0xf8, 0xde, 0xa9, 0xf2, 0x19, 0x2e, 0x5f, 0x69, 0x4b, 0x2b, 0x5d, 0xe2, 0x0b,
0x3a, 0x4f, 0x66, 0x27, 0xee, 0x21, 0xdc, 0x98, 0xba, 0x26, 0x8e, 0x83, 0x34, 0xc8, 0xa2, 0xe2,
0x2a, 0xef, 0x6e, 0xe6, 0x4b, 0xe2, 0xc7, 0xd6, 0x50, 0x7d, 0x40, 0xdc, 0x40, 0xf8, 0x61, 0x5c,
0xad, 0x39, 0xfe, 0x9f, 0x06, 0xd9, 0x54, 0xf5, 0x27, 0x59, 0x43, 0xd2, 0xb4, 0x2e, 0x91, 0x07,
0xc5, 0x5e, 0xe1, 0xfe, 0x0b, 0x3d, 0x8b, 0x02, 0xc0, 0xa1, 0x35, 0x9e, 0xd8, 0xb8, 0x63, 0x0f,
0x11, 0x27, 0x88, 0x3a, 0x3b, 0x6a, 0x90, 0x12, 0x73, 0x98, 0x5a, 0x5d, 0xe2, 0x9b, 0xd5, 0x5c,
0xb5, 0xb0, 0x99, 0x9a, 0x34, 0xc2, 0x4a, 0x73, 0x25, 0x15, 0xcc, 0x47, 0x71, 0xde, 0x9a, 0x9d,
0x47, 0xb1, 0x80, 0xc9, 0xa1, 0xd7, 0xe2, 0x20, 0xbd, 0xc8, 0xa2, 0xe2, 0xf6, 0x44, 0xfb, 0xb5,
0x5d, 0x9d, 0x83, 0xc5, 0x1e, 0xa2, 0xc6, 0x7c, 0x42, 0x77, 0xa0, 0x0d, 0x8a, 0x35, 0x5c, 0x8f,
0x20, 0x84, 0x1c, 0x16, 0x8d, 0xcf, 0x4d, 0xee, 0xfe, 0xcc, 0x74, 0x6f, 0x94, 0xff, 0x1e, 0x82,
0x75, 0xd8, 0x7e, 0xc9, 0xe2, 0x27, 0x00, 0x00, 0xff, 0xff, 0x7d, 0x27, 0x74, 0x80, 0xb6, 0x01,
0x00, 0x00,
}
...@@ -164,12 +164,12 @@ ...@@ -164,12 +164,12 @@
"revisionTime": "2016-11-17T07:43:51Z" "revisionTime": "2016-11-17T07:43:51Z"
}, },
{ {
"checksumSHA1": "I7Kz+IncdenJ5tOCo/5qJlQ4U7k=", "checksumSHA1": "3b0dq1/Vmln2vOY8upDIrDlucyo=",
"path": "gitlab.com/gitlab-org/gitaly-proto/go", "path": "gitlab.com/gitlab-org/gitaly-proto/go",
"revision": "8ac6c4c6cb2c124ff95cdd0f97bc4624055edc8f", "revision": "e3cc4aa1f29786b725db87b5f55f15aeb8670555",
"revisionTime": "2017-10-02T18:55:11Z", "revisionTime": "2017-10-12T15:06:35Z",
"version": "v0.39.0", "version": "v0.44.0",
"versionExact": "v0.39.0" "versionExact": "v0.44.0"
}, },
{ {
"checksumSHA1": "dUHJbKas746n5fLzlwxHb6FOCxs=", "checksumSHA1": "dUHJbKas746n5fLzlwxHb6FOCxs=",
......
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