Documentation ¶
Overview ¶
Package gerrit contains logic for interacting with Gerrit.
Index ¶
- func UseFakeClient(ctx context.Context, clsByHost map[string][]*gerritpb.ChangeInfo) context.Context
- type Client
- type FakeClient
- func (f *FakeClient) AbandonChange(ctx context.Context, in *gerritpb.AbandonChangeRequest, ...) (*gerritpb.ChangeInfo, error)
- func (f *FakeClient) AddReviewer(ctx context.Context, in *gerritpb.AddReviewerRequest, opts ...grpc.CallOption) (*gerritpb.AddReviewerResult, error)
- func (f *FakeClient) AddToAttentionSet(ctx context.Context, in *gerritpb.AttentionSetRequest, opts ...grpc.CallOption) (*gerritpb.AccountInfo, error)
- func (f *FakeClient) ChangeEditFileContent(ctx context.Context, in *gerritpb.ChangeEditFileContentRequest, ...) (*emptypb.Empty, error)
- func (f *FakeClient) ChangeEditPublish(ctx context.Context, in *gerritpb.ChangeEditPublishRequest, ...) (*emptypb.Empty, error)
- func (f *FakeClient) CreateChange(ctx context.Context, in *gerritpb.CreateChangeRequest, opts ...grpc.CallOption) (*gerritpb.ChangeInfo, error)
- func (f *FakeClient) DeleteEditFileContent(ctx context.Context, in *gerritpb.DeleteEditFileContentRequest, ...) (*emptypb.Empty, error)
- func (f *FakeClient) DeleteReviewer(ctx context.Context, in *gerritpb.DeleteReviewerRequest, ...) (*emptypb.Empty, error)
- func (f *FakeClient) GetChange(ctx context.Context, in *gerritpb.GetChangeRequest, opts ...grpc.CallOption) (*gerritpb.ChangeInfo, error)
- func (f *FakeClient) GetMergeable(ctx context.Context, in *gerritpb.GetMergeableRequest, opts ...grpc.CallOption) (*gerritpb.MergeableInfo, error)
- func (f *FakeClient) GetMetaDiff(ctx context.Context, in *gerritpb.GetMetaDiffRequest, opts ...grpc.CallOption) (*gerritpb.MetaDiff, error)
- func (f *FakeClient) GetPureRevert(ctx context.Context, in *gerritpb.GetPureRevertRequest, ...) (*gerritpb.PureRevertInfo, error)
- func (f *FakeClient) GetRefInfo(ctx context.Context, in *gerritpb.RefInfoRequest, opts ...grpc.CallOption) (*gerritpb.RefInfo, error)
- func (f *FakeClient) GetRelatedChanges(ctx context.Context, in *gerritpb.GetRelatedChangesRequest, ...) (*gerritpb.GetRelatedChangesResponse, error)
- func (f *FakeClient) ListAccountEmails(ctx context.Context, in *gerritpb.ListAccountEmailsRequest, ...) (*gerritpb.ListAccountEmailsResponse, error)
- func (f *FakeClient) ListChanges(ctx context.Context, in *gerritpb.ListChangesRequest, opts ...grpc.CallOption) (*gerritpb.ListChangesResponse, error)
- func (f *FakeClient) ListFileOwners(ctx context.Context, in *gerritpb.ListFileOwnersRequest, ...) (*gerritpb.ListOwnersResponse, error)
- func (f *FakeClient) ListFiles(ctx context.Context, in *gerritpb.ListFilesRequest, opts ...grpc.CallOption) (*gerritpb.ListFilesResponse, error)
- func (f *FakeClient) ListProjects(ctx context.Context, in *gerritpb.ListProjectsRequest, opts ...grpc.CallOption) (*gerritpb.ListProjectsResponse, error)
- func (f *FakeClient) RevertChange(ctx context.Context, in *gerritpb.RevertChangeRequest, opts ...grpc.CallOption) (*gerritpb.ChangeInfo, error)
- func (f *FakeClient) SetReview(ctx context.Context, in *gerritpb.SetReviewRequest, opts ...grpc.CallOption) (*gerritpb.ReviewResult, error)
- func (f *FakeClient) SubmitChange(ctx context.Context, in *gerritpb.SubmitChangeRequest, opts ...grpc.CallOption) (*gerritpb.ChangeInfo, error)
- func (f *FakeClient) SubmitRevision(ctx context.Context, in *gerritpb.SubmitRevisionRequest, ...) (*gerritpb.SubmitInfo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UseFakeClient ¶
func UseFakeClient(ctx context.Context, clsByHost map[string][]*gerritpb.ChangeInfo) context.Context
UseFakeClient installs a fake gerrit client into the context, with the given gerrit change data.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the client to communicate with Gerrit. It wraps a gerritpb.GerritClient.
func NewClient ¶
NewClient creates a client to communicate with Gerrit, acting as the given LUCI Project.
func (*Client) GetChange ¶
func (c *Client) GetChange(ctx context.Context, req *gerritpb.GetChangeRequest) (*gerritpb.ChangeInfo, error)
GetChange gets a gerrit change by its ID.
type FakeClient ¶
type FakeClient struct {
Changelists []*gerritpb.ChangeInfo
}
FakeClient is a fake implementation of gerritpb.GerritClient for testing.
func (*FakeClient) AbandonChange ¶
func (f *FakeClient) AbandonChange(ctx context.Context, in *gerritpb.AbandonChangeRequest, opts ...grpc.CallOption) (*gerritpb.ChangeInfo, error)
func (*FakeClient) AddReviewer ¶
func (f *FakeClient) AddReviewer(ctx context.Context, in *gerritpb.AddReviewerRequest, opts ...grpc.CallOption) (*gerritpb.AddReviewerResult, error)
func (*FakeClient) AddToAttentionSet ¶
func (f *FakeClient) AddToAttentionSet(ctx context.Context, in *gerritpb.AttentionSetRequest, opts ...grpc.CallOption) (*gerritpb.AccountInfo, error)
func (*FakeClient) ChangeEditFileContent ¶
func (f *FakeClient) ChangeEditFileContent(ctx context.Context, in *gerritpb.ChangeEditFileContentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
func (*FakeClient) ChangeEditPublish ¶
func (f *FakeClient) ChangeEditPublish(ctx context.Context, in *gerritpb.ChangeEditPublishRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
func (*FakeClient) CreateChange ¶
func (f *FakeClient) CreateChange(ctx context.Context, in *gerritpb.CreateChangeRequest, opts ...grpc.CallOption) (*gerritpb.ChangeInfo, error)
func (*FakeClient) DeleteEditFileContent ¶
func (f *FakeClient) DeleteEditFileContent(ctx context.Context, in *gerritpb.DeleteEditFileContentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
func (*FakeClient) DeleteReviewer ¶
func (f *FakeClient) DeleteReviewer(ctx context.Context, in *gerritpb.DeleteReviewerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
func (*FakeClient) GetChange ¶
func (f *FakeClient) GetChange(ctx context.Context, in *gerritpb.GetChangeRequest, opts ...grpc.CallOption) (*gerritpb.ChangeInfo, error)
func (*FakeClient) GetMergeable ¶
func (f *FakeClient) GetMergeable(ctx context.Context, in *gerritpb.GetMergeableRequest, opts ...grpc.CallOption) (*gerritpb.MergeableInfo, error)
func (*FakeClient) GetMetaDiff ¶
func (f *FakeClient) GetMetaDiff(ctx context.Context, in *gerritpb.GetMetaDiffRequest, opts ...grpc.CallOption) (*gerritpb.MetaDiff, error)
func (*FakeClient) GetPureRevert ¶
func (f *FakeClient) GetPureRevert(ctx context.Context, in *gerritpb.GetPureRevertRequest, opts ...grpc.CallOption) (*gerritpb.PureRevertInfo, error)
func (*FakeClient) GetRefInfo ¶
func (f *FakeClient) GetRefInfo(ctx context.Context, in *gerritpb.RefInfoRequest, opts ...grpc.CallOption) (*gerritpb.RefInfo, error)
func (*FakeClient) GetRelatedChanges ¶
func (f *FakeClient) GetRelatedChanges(ctx context.Context, in *gerritpb.GetRelatedChangesRequest, opts ...grpc.CallOption) (*gerritpb.GetRelatedChangesResponse, error)
func (*FakeClient) ListAccountEmails ¶
func (f *FakeClient) ListAccountEmails(ctx context.Context, in *gerritpb.ListAccountEmailsRequest, opts ...grpc.CallOption) (*gerritpb.ListAccountEmailsResponse, error)
func (*FakeClient) ListChanges ¶
func (f *FakeClient) ListChanges(ctx context.Context, in *gerritpb.ListChangesRequest, opts ...grpc.CallOption) (*gerritpb.ListChangesResponse, error)
func (*FakeClient) ListFileOwners ¶
func (f *FakeClient) ListFileOwners(ctx context.Context, in *gerritpb.ListFileOwnersRequest, opts ...grpc.CallOption) (*gerritpb.ListOwnersResponse, error)
func (*FakeClient) ListFiles ¶
func (f *FakeClient) ListFiles(ctx context.Context, in *gerritpb.ListFilesRequest, opts ...grpc.CallOption) (*gerritpb.ListFilesResponse, error)
func (*FakeClient) ListProjects ¶
func (f *FakeClient) ListProjects(ctx context.Context, in *gerritpb.ListProjectsRequest, opts ...grpc.CallOption) (*gerritpb.ListProjectsResponse, error)
func (*FakeClient) RevertChange ¶
func (f *FakeClient) RevertChange(ctx context.Context, in *gerritpb.RevertChangeRequest, opts ...grpc.CallOption) (*gerritpb.ChangeInfo, error)
func (*FakeClient) SetReview ¶
func (f *FakeClient) SetReview(ctx context.Context, in *gerritpb.SetReviewRequest, opts ...grpc.CallOption) (*gerritpb.ReviewResult, error)
func (*FakeClient) SubmitChange ¶
func (f *FakeClient) SubmitChange(ctx context.Context, in *gerritpb.SubmitChangeRequest, opts ...grpc.CallOption) (*gerritpb.ChangeInfo, error)
func (*FakeClient) SubmitRevision ¶
func (f *FakeClient) SubmitRevision(ctx context.Context, in *gerritpb.SubmitRevisionRequest, opts ...grpc.CallOption) (*gerritpb.SubmitInfo, error)
Click to show internal directories.
Click to hide internal directories.