gerrit

package
v0.0.0-...-9994f1b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2025 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Copyright 2023 The ChromiumOS Authors Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Copyright 2023 The Chromium Authors Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Copyright 2023 The ChromiumOS Authors. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Branch

type Branch struct {
	// Requested full (chromium-review.googlesource.com) or short (chromium) gerrit host.
	Host string `json:"host"`
	// Requested gerrit repo, e.g. "chromiumos/chromite".
	Project string `json:"project"`
	// Requested branch from the repo, e.g. "main".
	Branch string `json:"branch"`
	// Returned HEAD revision from that branch.
	Revision string `json:"revision"`
}

func MustFetchBranch

func MustFetchBranch(ctx context.Context, httpClient *http.Client, branch Branch) Branch

MustFetchBranch retrieves branch metadata from Gitiles.

type Change

type Change struct {
	// Full (chromium-review.googlesource.com) or short (chromium) gerrit host.
	Host string `json:"host"`
	// Change number requested.
	Number int `json:"change_number"`
	// Patch set number as requested. If in (-1, 0), fetch "current" patch set.
	PatchSet int `json:"patch_set"`

	// Change info if found.
	Info *gerrit.Change `json:"info"`
	// Patch set info if found.
	PatchSetRevision string               `json:"patch_set_revision"`
	RevisionInfo     *gerrit.RevisionInfo `json:"revision_info"`
}

type Changes

type Changes []*Change

func MustFetchChanges

func MustFetchChanges(parentCtx context.Context, httpClient *http.Client, changes Changes, options Options) Changes

Fetch changes from the given hosts (will only make one request per host) or die.

type File

type File struct {
	// Full (chromium.googlesource.com) or short (chromium) gitiles host.
	Host string `json:"host"`
	// Requested gerrit repo, e.g. "chromiumos/chromite".
	Project string `json:"project"`
	// Requested reference from the repo, e.g. "12fabada".
	Ref string `json:"ref"`
	// Requested file path.
	Path string `json:"path"`
	// Returned file content.
	Content string `json:"content"`
}

func MustFetchFile

func MustFetchFile(ctx context.Context, httpClient *http.Client, file File) File

Fetch file from the given hosts or die.

type Options

type Options struct {
	IncludeDetailedLabels bool `json:"include_detailed_labels"`
	IncludeFiles          bool `json:"include_files"`
	IncludeCommitInfo     bool `json:"include_commit_info"`
	IncludeMessages       bool `json:"include_messages"`
	IncludeSubmittable    bool `json:"include_submittable"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL