Documentation
¶
Overview ¶
Package api is a generated GoMock package.
Index ¶
- Variables
- func FileDescriptorSet() *descriptorpb.FileDescriptorSet
- func NewRESTServer(r *router.Router, grpcServer CrrevServer)
- func RegisterCrrevServer(s prpc.Registrar, srv CrrevServer)
- type CommitRequest
- type CommitResponse
- func (*CommitResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CommitResponse) GetGitHash() string
- func (x *CommitResponse) GetHost() string
- func (x *CommitResponse) GetPositionNumber() int64
- func (x *CommitResponse) GetRedirectUrl() string
- func (x *CommitResponse) GetRepository() string
- func (*CommitResponse) ProtoMessage()
- func (x *CommitResponse) ProtoReflect() protoreflect.Message
- func (x *CommitResponse) Reset()
- func (x *CommitResponse) String() string
- type CrrevClient
- type CrrevServer
- type MockCrrevClient
- func (m *MockCrrevClient) Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*CommitResponse, error)
- func (m *MockCrrevClient) EXPECT() *MockCrrevClientMockRecorder
- func (m *MockCrrevClient) Numbering(ctx context.Context, in *NumberingRequest, opts ...grpc.CallOption) (*NumberingResponse, error)
- func (m *MockCrrevClient) Redirect(ctx context.Context, in *RedirectRequest, opts ...grpc.CallOption) (*RedirectResponse, error)
- type MockCrrevClientMockRecorder
- func (mr *MockCrrevClientMockRecorder) Commit(ctx, in interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockCrrevClientMockRecorder) Numbering(ctx, in interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockCrrevClientMockRecorder) Redirect(ctx, in interface{}, opts ...interface{}) *gomock.Call
- type MockCrrevServer
- func (m *MockCrrevServer) Commit(arg0 context.Context, arg1 *CommitRequest) (*CommitResponse, error)
- func (m *MockCrrevServer) EXPECT() *MockCrrevServerMockRecorder
- func (m *MockCrrevServer) Numbering(arg0 context.Context, arg1 *NumberingRequest) (*NumberingResponse, error)
- func (m *MockCrrevServer) Redirect(arg0 context.Context, arg1 *RedirectRequest) (*RedirectResponse, error)
- type MockCrrevServerMockRecorder
- type NumberingRequest
- func (*NumberingRequest) Descriptor() ([]byte, []int)deprecated
- func (x *NumberingRequest) GetHost() string
- func (x *NumberingRequest) GetPositionNumber() int64
- func (x *NumberingRequest) GetPositionRef() string
- func (x *NumberingRequest) GetRepository() string
- func (*NumberingRequest) ProtoMessage()
- func (x *NumberingRequest) ProtoReflect() protoreflect.Message
- func (x *NumberingRequest) Reset()
- func (x *NumberingRequest) String() string
- type NumberingResponse
- func (*NumberingResponse) Descriptor() ([]byte, []int)deprecated
- func (x *NumberingResponse) GetGitHash() string
- func (x *NumberingResponse) GetHost() string
- func (x *NumberingResponse) GetPositionNumber() int64
- func (x *NumberingResponse) GetRepository() string
- func (*NumberingResponse) ProtoMessage()
- func (x *NumberingResponse) ProtoReflect() protoreflect.Message
- func (x *NumberingResponse) Reset()
- func (x *NumberingResponse) String() string
- type RedirectRequest
- type RedirectResponse
- func (*RedirectResponse) Descriptor() ([]byte, []int)deprecated
- func (x *RedirectResponse) GetGitHash() string
- func (x *RedirectResponse) GetHost() string
- func (x *RedirectResponse) GetRedirectUrl() string
- func (x *RedirectResponse) GetRepository() string
- func (*RedirectResponse) ProtoMessage()
- func (x *RedirectResponse) ProtoReflect() protoreflect.Message
- func (x *RedirectResponse) Reset()
- func (x *RedirectResponse) String() string
- type UnimplementedCrrevServer
- func (*UnimplementedCrrevServer) Commit(context.Context, *CommitRequest) (*CommitResponse, error)
- func (*UnimplementedCrrevServer) Numbering(context.Context, *NumberingRequest) (*NumberingResponse, error)
- func (*UnimplementedCrrevServer) Redirect(context.Context, *RedirectRequest) (*RedirectResponse, error)
Constants ¶
This section is empty.
Variables ¶
var File_infra_appengine_cr_rev_frontend_api_v1_service_proto protoreflect.FileDescriptor
Functions ¶
func FileDescriptorSet ¶
func FileDescriptorSet() *descriptorpb.FileDescriptorSet
FileDescriptorSet returns a descriptor set for this proto package, which includes all defined services, and all transitive dependencies.
Will not return nil.
Do NOT modify the returned descriptor.
func NewRESTServer ¶
func NewRESTServer(r *router.Router, grpcServer CrrevServer)
NewRESTServer installs REST handlers to provided router.
func RegisterCrrevServer ¶
func RegisterCrrevServer(s prpc.Registrar, srv CrrevServer)
Types ¶
type CommitRequest ¶
type CommitRequest struct { // git_hash is a full git commit hash of desired commit. GitHash string `protobuf:"bytes,1,opt,name=git_hash,json=gitHash,proto3" json:"git_hash,omitempty"` // contains filtered or unexported fields }
func (*CommitRequest) Descriptor
deprecated
func (*CommitRequest) Descriptor() ([]byte, []int)
Deprecated: Use CommitRequest.ProtoReflect.Descriptor instead.
func (*CommitRequest) GetGitHash ¶
func (x *CommitRequest) GetGitHash() string
func (*CommitRequest) ProtoMessage ¶
func (*CommitRequest) ProtoMessage()
func (*CommitRequest) ProtoReflect ¶
func (x *CommitRequest) ProtoReflect() protoreflect.Message
func (*CommitRequest) Reset ¶
func (x *CommitRequest) Reset()
func (*CommitRequest) String ¶
func (x *CommitRequest) String() string
type CommitResponse ¶
type CommitResponse struct { // git_hash is a full git commit hash of matched commit that is used for // redirect. GitHash string `protobuf:"bytes,1,opt,name=git_hash,json=git_sha,proto3" json:"git_hash,omitempty"` // host is googlesource host (e.g. chromium). Host string `protobuf:"bytes,2,opt,name=host,json=project,proto3" json:"host,omitempty"` // repository is Git repository (e.g. chromium/src) Repository string `protobuf:"bytes,3,opt,name=repository,json=repo,proto3" json:"repository,omitempty"` // position_number is sequential identifier of commit in given branch // (position_ref). PositionNumber int64 `protobuf:"varint,4,opt,name=position_number,json=number,proto3" json:"position_number,omitempty"` // redirect_url is Gitiles URL of the commit, the same URL that user is // redirected to when using crrev's main redirect logic. RedirectUrl string `protobuf:"bytes,5,opt,name=redirect_url,json=redirectUrl,proto3" json:"redirect_url,omitempty"` // contains filtered or unexported fields }
func (*CommitResponse) Descriptor
deprecated
func (*CommitResponse) Descriptor() ([]byte, []int)
Deprecated: Use CommitResponse.ProtoReflect.Descriptor instead.
func (*CommitResponse) GetGitHash ¶
func (x *CommitResponse) GetGitHash() string
func (*CommitResponse) GetHost ¶
func (x *CommitResponse) GetHost() string
func (*CommitResponse) GetPositionNumber ¶
func (x *CommitResponse) GetPositionNumber() int64
func (*CommitResponse) GetRedirectUrl ¶
func (x *CommitResponse) GetRedirectUrl() string
func (*CommitResponse) GetRepository ¶
func (x *CommitResponse) GetRepository() string
func (*CommitResponse) ProtoMessage ¶
func (*CommitResponse) ProtoMessage()
func (*CommitResponse) ProtoReflect ¶
func (x *CommitResponse) ProtoReflect() protoreflect.Message
func (*CommitResponse) Reset ¶
func (x *CommitResponse) Reset()
func (*CommitResponse) String ¶
func (x *CommitResponse) String() string
type CrrevClient ¶
type CrrevClient interface { // Redirect implements the same logic as the main crrev redirect, but returns // redirect and commit information in body instead of HTTP redirect. Redirect(ctx context.Context, in *RedirectRequest, opts ...grpc.CallOption) (*RedirectResponse, error) // Numbering returns commit that matches desired position of commit, based on // NumberingRequest parameters. Commit position is based on git-footer // git-svn-id or Cr-Commit-Position. Numbering(ctx context.Context, in *NumberingRequest, opts ...grpc.CallOption) (*NumberingResponse, error) // Commit returns commit with desired commit hash. If there are multiple // commits with the same commit hash (which happens with forks and mirrors), // it checks priorities based on config. It is possible that priorities are // the same. In such case, there is no guarantee which one will be returned. Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*CommitResponse, error) }
CrrevClient is the client API for Crrev service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewCrrevClient ¶
func NewCrrevClient(cc grpc.ClientConnInterface) CrrevClient
func NewCrrevPRPCClient ¶
func NewCrrevPRPCClient(client *prpc.Client) CrrevClient
type CrrevServer ¶
type CrrevServer interface { // Redirect implements the same logic as the main crrev redirect, but returns // redirect and commit information in body instead of HTTP redirect. Redirect(context.Context, *RedirectRequest) (*RedirectResponse, error) // Numbering returns commit that matches desired position of commit, based on // NumberingRequest parameters. Commit position is based on git-footer // git-svn-id or Cr-Commit-Position. Numbering(context.Context, *NumberingRequest) (*NumberingResponse, error) // Commit returns commit with desired commit hash. If there are multiple // commits with the same commit hash (which happens with forks and mirrors), // it checks priorities based on config. It is possible that priorities are // the same. In such case, there is no guarantee which one will be returned. Commit(context.Context, *CommitRequest) (*CommitResponse, error) }
CrrevServer is the server API for Crrev service.
func NewServer ¶
func NewServer(rules *redirect.Rules) CrrevServer
NewServer returns new instance of CrrevServer. It uses datastore to retrieve commit information. Passed rules should match cr-rev main redirect rules.
type MockCrrevClient ¶
type MockCrrevClient struct {
// contains filtered or unexported fields
}
MockCrrevClient is a mock of CrrevClient interface.
func NewMockCrrevClient ¶
func NewMockCrrevClient(ctrl *gomock.Controller) *MockCrrevClient
NewMockCrrevClient creates a new mock instance.
func (*MockCrrevClient) Commit ¶
func (m *MockCrrevClient) Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*CommitResponse, error)
Commit mocks base method.
func (*MockCrrevClient) EXPECT ¶
func (m *MockCrrevClient) EXPECT() *MockCrrevClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockCrrevClient) Numbering ¶
func (m *MockCrrevClient) Numbering(ctx context.Context, in *NumberingRequest, opts ...grpc.CallOption) (*NumberingResponse, error)
Numbering mocks base method.
func (*MockCrrevClient) Redirect ¶
func (m *MockCrrevClient) Redirect(ctx context.Context, in *RedirectRequest, opts ...grpc.CallOption) (*RedirectResponse, error)
Redirect mocks base method.
type MockCrrevClientMockRecorder ¶
type MockCrrevClientMockRecorder struct {
// contains filtered or unexported fields
}
MockCrrevClientMockRecorder is the mock recorder for MockCrrevClient.
func (*MockCrrevClientMockRecorder) Commit ¶
func (mr *MockCrrevClientMockRecorder) Commit(ctx, in interface{}, opts ...interface{}) *gomock.Call
Commit indicates an expected call of Commit.
func (*MockCrrevClientMockRecorder) Numbering ¶
func (mr *MockCrrevClientMockRecorder) Numbering(ctx, in interface{}, opts ...interface{}) *gomock.Call
Numbering indicates an expected call of Numbering.
func (*MockCrrevClientMockRecorder) Redirect ¶
func (mr *MockCrrevClientMockRecorder) Redirect(ctx, in interface{}, opts ...interface{}) *gomock.Call
Redirect indicates an expected call of Redirect.
type MockCrrevServer ¶
type MockCrrevServer struct {
// contains filtered or unexported fields
}
MockCrrevServer is a mock of CrrevServer interface.
func NewMockCrrevServer ¶
func NewMockCrrevServer(ctrl *gomock.Controller) *MockCrrevServer
NewMockCrrevServer creates a new mock instance.
func (*MockCrrevServer) Commit ¶
func (m *MockCrrevServer) Commit(arg0 context.Context, arg1 *CommitRequest) (*CommitResponse, error)
Commit mocks base method.
func (*MockCrrevServer) EXPECT ¶
func (m *MockCrrevServer) EXPECT() *MockCrrevServerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockCrrevServer) Numbering ¶
func (m *MockCrrevServer) Numbering(arg0 context.Context, arg1 *NumberingRequest) (*NumberingResponse, error)
Numbering mocks base method.
func (*MockCrrevServer) Redirect ¶
func (m *MockCrrevServer) Redirect(arg0 context.Context, arg1 *RedirectRequest) (*RedirectResponse, error)
Redirect mocks base method.
type MockCrrevServerMockRecorder ¶
type MockCrrevServerMockRecorder struct {
// contains filtered or unexported fields
}
MockCrrevServerMockRecorder is the mock recorder for MockCrrevServer.
func (*MockCrrevServerMockRecorder) Commit ¶
func (mr *MockCrrevServerMockRecorder) Commit(arg0, arg1 interface{}) *gomock.Call
Commit indicates an expected call of Commit.
func (*MockCrrevServerMockRecorder) Numbering ¶
func (mr *MockCrrevServerMockRecorder) Numbering(arg0, arg1 interface{}) *gomock.Call
Numbering indicates an expected call of Numbering.
func (*MockCrrevServerMockRecorder) Redirect ¶
func (mr *MockCrrevServerMockRecorder) Redirect(arg0, arg1 interface{}) *gomock.Call
Redirect indicates an expected call of Redirect.
type NumberingRequest ¶
type NumberingRequest struct { // host is googlesource host (e.g. chromium). Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` // repository is Git repository (e.g. chromium/src) Repository string `protobuf:"bytes,2,opt,name=repository,proto3" json:"repository,omitempty"` // position_ref is name of position defined in value of git-footer git-svn-id // or Cr-Commit-Position (e.g. refs/heads/master, // svn://svn.chromium.org/chrome/trunk/src) PositionRef string `protobuf:"bytes,3,opt,name=position_ref,json=positionRef,proto3" json:"position_ref,omitempty"` // position_number is sequential identifier of commit in given branch // (position_ref). PositionNumber int64 `protobuf:"varint,4,opt,name=position_number,json=positionNumber,proto3" json:"position_number,omitempty"` // contains filtered or unexported fields }
func (*NumberingRequest) Descriptor
deprecated
func (*NumberingRequest) Descriptor() ([]byte, []int)
Deprecated: Use NumberingRequest.ProtoReflect.Descriptor instead.
func (*NumberingRequest) GetHost ¶
func (x *NumberingRequest) GetHost() string
func (*NumberingRequest) GetPositionNumber ¶
func (x *NumberingRequest) GetPositionNumber() int64
func (*NumberingRequest) GetPositionRef ¶
func (x *NumberingRequest) GetPositionRef() string
func (*NumberingRequest) GetRepository ¶
func (x *NumberingRequest) GetRepository() string
func (*NumberingRequest) ProtoMessage ¶
func (*NumberingRequest) ProtoMessage()
func (*NumberingRequest) ProtoReflect ¶
func (x *NumberingRequest) ProtoReflect() protoreflect.Message
func (*NumberingRequest) Reset ¶
func (x *NumberingRequest) Reset()
func (*NumberingRequest) String ¶
func (x *NumberingRequest) String() string
type NumberingResponse ¶
type NumberingResponse struct { // git_hash is a full git commit hash of matched commit that is used for // redirect. GitHash string `protobuf:"bytes,1,opt,name=git_hash,json=git_sha,proto3" json:"git_hash,omitempty"` // position_number matches NumberingRequest position_number. Probably useless // to clients, but kept for backward compatibility. PositionNumber int64 `protobuf:"varint,2,opt,name=position_number,json=number,proto3" json:"position_number,omitempty"` // host matches NumberingRequest host. Probably useless to clients, but kept // for backward compatibility. Host string `protobuf:"bytes,3,opt,name=host,json=project,proto3" json:"host,omitempty"` // repository matches NumberingRequest repository. Probably useless to // clients, but kept for backward compatibility. Repository string `protobuf:"bytes,4,opt,name=repository,json=repo,proto3" json:"repository,omitempty"` // contains filtered or unexported fields }
func (*NumberingResponse) Descriptor
deprecated
func (*NumberingResponse) Descriptor() ([]byte, []int)
Deprecated: Use NumberingResponse.ProtoReflect.Descriptor instead.
func (*NumberingResponse) GetGitHash ¶
func (x *NumberingResponse) GetGitHash() string
func (*NumberingResponse) GetHost ¶
func (x *NumberingResponse) GetHost() string
func (*NumberingResponse) GetPositionNumber ¶
func (x *NumberingResponse) GetPositionNumber() int64
func (*NumberingResponse) GetRepository ¶
func (x *NumberingResponse) GetRepository() string
func (*NumberingResponse) ProtoMessage ¶
func (*NumberingResponse) ProtoMessage()
func (*NumberingResponse) ProtoReflect ¶
func (x *NumberingResponse) ProtoReflect() protoreflect.Message
func (*NumberingResponse) Reset ¶
func (x *NumberingResponse) Reset()
func (*NumberingResponse) String ¶
func (x *NumberingResponse) String() string
type RedirectRequest ¶
type RedirectRequest struct { // query is equal to URL path of crrev main redirect logic. For example, it // can be "/3" (redirect to chromium/src commit with position 3) or // /{some_commit_hash} (redirect to some repository based on // some_commit_hash), etc. Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` // contains filtered or unexported fields }
func (*RedirectRequest) Descriptor
deprecated
func (*RedirectRequest) Descriptor() ([]byte, []int)
Deprecated: Use RedirectRequest.ProtoReflect.Descriptor instead.
func (*RedirectRequest) GetQuery ¶
func (x *RedirectRequest) GetQuery() string
func (*RedirectRequest) ProtoMessage ¶
func (*RedirectRequest) ProtoMessage()
func (*RedirectRequest) ProtoReflect ¶
func (x *RedirectRequest) ProtoReflect() protoreflect.Message
func (*RedirectRequest) Reset ¶
func (x *RedirectRequest) Reset()
func (*RedirectRequest) String ¶
func (x *RedirectRequest) String() string
type RedirectResponse ¶
type RedirectResponse struct { // git_hash is a full git commit hash of matched commit that is used for // redirect. GitHash string `protobuf:"bytes,1,opt,name=git_hash,json=git_sha,proto3" json:"git_hash,omitempty"` // host is googlesource host (e.g. chromium). Host string `protobuf:"bytes,2,opt,name=host,json=project,proto3" json:"host,omitempty"` // repository is Git repository (e.g. chromium/src) Repository string `protobuf:"bytes,3,opt,name=repository,json=repo,proto3" json:"repository,omitempty"` // redirect_url is Gitiles URL of the commit, the same URL that user is // redirected to when using crrev's main redirect logic. RedirectUrl string `protobuf:"bytes,4,opt,name=redirect_url,json=redirectUrl,proto3" json:"redirect_url,omitempty"` // contains filtered or unexported fields }
func (*RedirectResponse) Descriptor
deprecated
func (*RedirectResponse) Descriptor() ([]byte, []int)
Deprecated: Use RedirectResponse.ProtoReflect.Descriptor instead.
func (*RedirectResponse) GetGitHash ¶
func (x *RedirectResponse) GetGitHash() string
func (*RedirectResponse) GetHost ¶
func (x *RedirectResponse) GetHost() string
func (*RedirectResponse) GetRedirectUrl ¶
func (x *RedirectResponse) GetRedirectUrl() string
func (*RedirectResponse) GetRepository ¶
func (x *RedirectResponse) GetRepository() string
func (*RedirectResponse) ProtoMessage ¶
func (*RedirectResponse) ProtoMessage()
func (*RedirectResponse) ProtoReflect ¶
func (x *RedirectResponse) ProtoReflect() protoreflect.Message
func (*RedirectResponse) Reset ¶
func (x *RedirectResponse) Reset()
func (*RedirectResponse) String ¶
func (x *RedirectResponse) String() string
type UnimplementedCrrevServer ¶
type UnimplementedCrrevServer struct { }
UnimplementedCrrevServer can be embedded to have forward compatible implementations.
func (*UnimplementedCrrevServer) Commit ¶
func (*UnimplementedCrrevServer) Commit(context.Context, *CommitRequest) (*CommitResponse, error)
func (*UnimplementedCrrevServer) Numbering ¶
func (*UnimplementedCrrevServer) Numbering(context.Context, *NumberingRequest) (*NumberingResponse, error)
func (*UnimplementedCrrevServer) Redirect ¶
func (*UnimplementedCrrevServer) Redirect(context.Context, *RedirectRequest) (*RedirectResponse, error)