Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetTestClientFactory

func SetTestClientFactory(ctx context.Context, clientMap map[string]Client) context.Context

    SetTestClientFactory sets up a ClientFactory for testing, where clientMap is a map whose keys are gerrit hosts, values are corresponding testing Gerrit clients.

    func Setup

    func Setup(ctx context.Context) context.Context

      Setup puts a production ClientFactory into the context.

      Types

      type CLReaderClient

      type CLReaderClient interface {
      	// Lists changes that match a query.
      	//
      	// https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-changes
      	ListChanges(ctx context.Context, in *gerritpb.ListChangesRequest, opts ...grpc.CallOption) (*gerritpb.ListChangesResponse, error)
      	// Lists the files that were modified, added or deleted in a revision.
      	//
      	// https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-files
      	ListFiles(ctx context.Context, in *gerritpb.ListFilesRequest, opts ...grpc.CallOption) (*gerritpb.ListFilesResponse, error)
      	// Check if the given change is a pure revert of the change it references in
      	// revertOf. See also ChangeInfo.revert_of.
      	//
      	// https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-pure-revert
      	GetPureRevert(ctx context.Context, in *gerritpb.GetPureRevertRequest, opts ...grpc.CallOption) (*gerritpb.PureRevertInfo, error)
      	// Loads a change by id.
      	//
      	// https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-change
      	GetChange(ctx context.Context, in *gerritpb.GetChangeRequest, opts ...grpc.CallOption) (*gerritpb.ChangeInfo, error)
      	// Gets Mergeable status for a change.
      	//
      	// https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-mergeable
      	GetMergeable(ctx context.Context, in *gerritpb.GetMergeableRequest, opts ...grpc.CallOption) (*gerritpb.MergeableInfo, error)
      }

        CLReaderClient defines a subset of Gerrit API used by rubber-stamper to fetch CL details.

        type CLWriterClient

          CLWriterClient defines a subset of Gerrit API used by rubber-stamper to review CLs.

          type Client

          type Client interface {
          	CLReaderClient
          	CLWriterClient
          }

            Client defines a subset of Gerrit API used by rubber-stamper.

            func GetCurrentClient

            func GetCurrentClient(ctx context.Context, gerritHost string) (Client, error)

              GetCurrentClient returns the Client in the context or an error.

              type ClientFactory

              type ClientFactory func(ctx context.Context, gerritHost string) (Client, error)

                ClientFactory creates Client tied to Gerrit host and LUCI project.

                Source Files