go-gerrit: github.com/andygrunwald/go-gerrit Index | Examples | Files

package gerrit

import "github.com/andygrunwald/go-gerrit"

Package gerrit provides a client for using the Gerrit API.

Construct a new Gerrit client, then use the various services on the client to access different parts of the Gerrit API. For example:

instance := "https://go-review.googlesource.com/"
client, _ := gerrit.NewClient(instance, nil)

// Get all public projects
projects, _, err := client.Projects.ListProjects(nil)

Set optional parameters for an API method by passing an Options object.

// Get all projects with descriptions
opt := &gerrit.ProjectOptions{
	Description: true,
}
projects, _, err := client.Projects.ListProjects(opt)

The services of a client divide the API into logical chunks and correspond to the structure of the Gerrit API documentation at https://gerrit-review.googlesource.com/Documentation/rest-api.html#_endpoints.

Authentication

The go-gerrit library supports various methods to support the authentication. This methods are combined in the AuthenticationService that is available at client.Authentication.

One way is an authentication via HTTP cookie. Some Gerrit instances hosted like the one hosted googlesource.com (e.g. https://go-review.googlesource.com/, https://android-review.googlesource.com/ or https://gerrit-review.googlesource.com/) support HTTP Cookie authentication.

You need the cookie name and the cookie value. You can get them by click on "Settings > HTTP Password > Obtain Password" in your Gerrit instance. There you can receive your values. The cookie name will be (mostly) "o" (if hosted on googlesource.com). Your cookie secret will be something like "git-your@email.com=SomeHash...".

instance := "https://gerrit-review.googlesource.com/"
client, _ := gerrit.NewClient(instance, nil)
client.Authentication.SetCookieAuth("o", "my-cookie-secret")

self, _, _ := client.Accounts.GetAccount("self")

fmt.Printf("Username: %s", self.Name)

// Username: Andy G.

Some other Gerrit instances (like https://review.typo3.org/) has auth.gitBasicAuth activated. With this you can authenticate with HTTP Basic like this:

instance := "https://review.typo3.org/"
client, _ := gerrit.NewClient(instance, nil)
client.Authentication.SetBasicAuth("andy.grunwald", "my secrect password")

self, _, _ := client.Accounts.GetAccount("self")

fmt.Printf("Username: %s", self.Name)

// Username: Andy Grunwald

Additionally when creating a new client, pass an http.Client that supports further actions for you. For more information regarding authentication have a look at the Gerrit documentation: https://gerrit-review.googlesource.com/Documentation/rest-api.html#authentication

Index

Examples

Package Files

access.go accounts.go authentication.go changes.go changes_edit.go changes_reviewer.go changes_revision.go config.go doc.go events.go gerrit.go groups.go groups_include.go groups_member.go plugins.go projects.go projects_branch.go projects_childproject.go projects_commit.go projects_dashboard.go projects_tag.go types.go

Variables

var (
    // ErrWWWAuthenticateHeaderMissing is returned by digestAuthHeader when the WWW-Authenticate header is missing
    ErrWWWAuthenticateHeaderMissing = errors.New("WWW-Authenticate header is missing")

    // ErrWWWAuthenticateHeaderInvalid is returned by digestAuthHeader when the WWW-Authenticate invalid
    ErrWWWAuthenticateHeaderInvalid = errors.New("WWW-Authenticate header is invalid")

    // ErrWWWAuthenticateHeaderNotDigest is returned by digestAuthHeader when the WWW-Authenticate header is not 'Digest'
    ErrWWWAuthenticateHeaderNotDigest = errors.New("WWW-Authenticate header type is not Digest")
)
var (
    // ErrNoInstanceGiven is returned by NewClient in the event the
    // gerritURL argument was blank.
    ErrNoInstanceGiven = errors.New("no Gerrit instance given")

    // ErrUserProvidedWithoutPassword is returned by NewClient
    // if a user name is provided without a password.
    ErrUserProvidedWithoutPassword = errors.New("a username was provided without a password")

    // ErrAuthenticationFailed is returned by NewClient in the event the provided
    // credentials didn't allow us to query account information using digest, basic or cookie
    // auth.
    ErrAuthenticationFailed = errors.New("failed to authenticate using the provided credentials")

    // ReParseURL is used to parse the url provided to NewClient(). This
    // regular expression contains five groups which capture the scheme,
    // username, password, hostname and port. If we parse the url with this
    // regular expression
    ReParseURL = regexp.MustCompile(`^(http|https)://(.+):(.+)@(.+):(\d+)(.*)$`)
)

func CheckResponse Uses

func CheckResponse(r *http.Response) error

CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range. API error responses are expected to have no response body.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api.html#response-codes

func RemoveMagicPrefixLine Uses

func RemoveMagicPrefixLine(body []byte) []byte

RemoveMagicPrefixLine removes the "magic prefix line" of Gerris JSON response if present. The JSON response body starts with a magic prefix line that must be stripped before feeding the rest of the response body to a JSON parser. The reason for this is to prevent against Cross Site Script Inclusion (XSSI) attacks. By default all standard Gerrit APIs include this prefix line though some plugins may not.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api.html#output

type AbandonInput Uses

type AbandonInput struct {
    Message       string       `json:"message,omitempty"`
    Notify        string       `json:"notify"`
    NotifyDetails []NotifyInfo `json:"notify_details"`
}

AbandonInput entity contains information for abandoning a change.

type AccessSectionInfo Uses

type AccessSectionInfo struct {
    Permissions map[string]PermissionInfo `json:"permissions"`
}

AccessSectionInfo describes the access rights that are assigned on a ref.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-access.html#access-section-info

type AccessService Uses

type AccessService struct {
    // contains filtered or unexported fields
}

AccessService contains Access Right related REST endpoints

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-access.html

func (*AccessService) ListAccessRights Uses

func (s *AccessService) ListAccessRights(opt *ListAccessRightsOptions) (*map[string]ProjectAccessInfo, *Response, error)

ListAccessRights lists the access rights for projects. As result a map is returned that maps the project name to ProjectAccessInfo entities. The entries in the map are sorted by project name.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-access.html#list-access

type AccountCapabilityInfo Uses

type AccountCapabilityInfo struct {
    AccessDatabase     bool           `json:"accessDatabase,omitempty"`
    AdministrateServer bool           `json:"administrateServer,omitempty"`
    CreateAccount      bool           `json:"createAccount,omitempty"`
    CreateGroup        bool           `json:"createGroup,omitempty"`
    CreateProject      bool           `json:"createProject,omitempty"`
    EmailReviewers     bool           `json:"emailReviewers,omitempty"`
    FlushCaches        bool           `json:"flushCaches,omitempty"`
    KillTask           bool           `json:"killTask,omitempty"`
    MaintainServer     bool           `json:"maintainServer,omitempty"`
    Priority           string         `json:"priority,omitempty"`
    QueryLimit         QueryLimitInfo `json:"queryLimit"`
    RunAs              bool           `json:"runAs,omitempty"`
    RunGC              bool           `json:"runGC,omitempty"`
    StreamEvents       bool           `json:"streamEvents,omitempty"`
    ViewAllAccounts    bool           `json:"viewAllAccounts,omitempty"`
    ViewCaches         bool           `json:"viewCaches,omitempty"`
    ViewConnections    bool           `json:"viewConnections,omitempty"`
    ViewPlugins        bool           `json:"viewPlugins,omitempty"`
    ViewQueue          bool           `json:"viewQueue,omitempty"`
}

AccountCapabilityInfo entity contains information about the global capabilities of a user.

type AccountDetailInfo Uses

type AccountDetailInfo struct {
    AccountInfo
    RegisteredOn Timestamp `json:"registered_on"`
}

AccountDetailInfo entity contains detailed information about an account.

type AccountInfo Uses

type AccountInfo struct {
    AccountID int    `json:"_account_id,omitempty"`
    Name      string `json:"name,omitempty"`
    Email     string `json:"email,omitempty"`
    Username  string `json:"username,omitempty"`

    // Avatars lists avatars of various sizes for the account.
    // This field is only populated if the avatars plugin is enabled.
    Avatars []struct {
        URL    string `json:"url,omitempty"`
        Height int    `json:"height,omitempty"`
    }   `json:"avatars,omitempty"`
}

AccountInfo entity contains information about an account.

type AccountInput Uses

type AccountInput struct {
    Username     string   `json:"username,omitempty"`
    Name         string   `json:"name,omitempty"`
    Email        string   `json:"email,omitempty"`
    SSHKey       string   `json:"ssh_key,omitempty"`
    HTTPPassword string   `json:"http_password,omitempty"`
    Groups       []string `json:"groups,omitempty"`
}

AccountInput entity contains information for the creation of a new account.

type AccountNameInput Uses

type AccountNameInput struct {
    Name string `json:"name,omitempty"`
}

AccountNameInput entity contains information for setting a name for an account.

type AccountsService Uses

type AccountsService struct {
    // contains filtered or unexported fields
}

AccountsService contains Account related REST endpoints

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html

func (*AccountsService) AddGPGKeys Uses

func (s *AccountsService) AddGPGKeys(accountID string, input *GpgKeysInput) (*map[string]GpgKeyInfo, *Response, error)

AddGPGKeys Add or delete one or more GPG keys for a user. The changes must be provided in the request body as a GpgKeysInput entity. Each new GPG key is provided in ASCII armored format, and must contain a self-signed certification matching a registered email or other identity of the user.

As a response, the modified GPG keys are returned as a map of GpgKeyInfo entities, keyed by ID. Deleted keys are represented by an empty object.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#add-delete-gpg-keys

func (*AccountsService) CheckAccountCapability Uses

func (s *AccountsService) CheckAccountCapability(accountID, capabilityID string) (string, *Response, error)

CheckAccountCapability checks if a user has a certain global capability.

If the user has the global capability the string ok is returned. If the user doesn’t have the global capability the response is “404 Not Found”.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#check-account-capability

func (*AccountsService) CreateAccount Uses

func (s *AccountsService) CreateAccount(username string, input *AccountInput) (*AccountInfo, *Response, error)

CreateAccount creates a new account. In the request body additional data for the account can be provided as AccountInput.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#create-account

func (*AccountsService) CreateAccountEmail Uses

func (s *AccountsService) CreateAccountEmail(accountID, emailID string, input *EmailInput) (*EmailInfo, *Response, error)

CreateAccountEmail registers a new email address for the user. A verification email is sent with a link that needs to be visited to confirm the email address, unless DEVELOPMENT_BECOME_ANY_ACCOUNT is used as authentication type. For the development mode email addresses are directly added without confirmation. A Gerrit administrator may add an email address without confirmation by setting no_confirmation in the EmailInput. In the request body additional data for the email address can be provided as EmailInput.

As response the new email address is returned as EmailInfo entity.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#create-account-email

func (*AccountsService) DeleteAccountEmail Uses

func (s *AccountsService) DeleteAccountEmail(accountID, emailID string) (*Response, error)

DeleteAccountEmail deletes an email address of an account.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#delete-account-email

func (*AccountsService) DeleteAccountName Uses

func (s *AccountsService) DeleteAccountName(accountID string) (*Response, error)

DeleteAccountName deletes the name of an account.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#delete-account-name

func (*AccountsService) DeleteActive Uses

func (s *AccountsService) DeleteActive(accountID string) (*Response, error)

DeleteActive sets the account state to inactive. If the account was already inactive the response is “404 Not Found”.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#delete-active

func (*AccountsService) DeleteGPGKey Uses

func (s *AccountsService) DeleteGPGKey(accountID, gpgKeyID string) (*Response, error)

DeleteGPGKey deletes a GPG key of a user.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#delete-gpg-key

func (*AccountsService) DeleteHTTPPassword Uses

func (s *AccountsService) DeleteHTTPPassword(accountID string) (*Response, error)

DeleteHTTPPassword deletes the HTTP password of an account.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#delete-http-password

func (*AccountsService) DeleteSSHKey Uses

func (s *AccountsService) DeleteSSHKey(accountID, sshKeyID string) (*Response, error)

DeleteSSHKey deletes an SSH key of a user.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#delete-ssh-key

func (*AccountsService) GetAccount Uses

func (s *AccountsService) GetAccount(account string) (*AccountInfo, *Response, error)

GetAccount returns an account as an AccountInfo entity. If account is "self" the current authenticated account will be returned.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-account

func (*AccountsService) GetAccountDetails Uses

func (s *AccountsService) GetAccountDetails(accountID string) (*AccountDetailInfo, *Response, error)

GetAccountDetails retrieves the details of an account.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-detail

func (*AccountsService) GetAccountEmail Uses

func (s *AccountsService) GetAccountEmail(accountID, emailID string) (*EmailInfo, *Response, error)

GetAccountEmail retrieves an email address of a user.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-account-email

func (*AccountsService) GetAccountName Uses

func (s *AccountsService) GetAccountName(accountID string) (string, *Response, error)

GetAccountName retrieves the full name of an account.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-account-name

func (*AccountsService) GetActive Uses

func (s *AccountsService) GetActive(accountID string) (string, *Response, error)

GetActive checks if an account is active.

If the account is active the string ok is returned. If the account is inactive the response is “204 No Content”.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-active

func (*AccountsService) GetAvatarChangeURL Uses

func (s *AccountsService) GetAvatarChangeURL(accountID string) (string, *Response, error)

GetAvatarChangeURL retrieves the URL where the user can change the avatar image.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-avatar-change-url

func (*AccountsService) GetDiffPreferences Uses

func (s *AccountsService) GetDiffPreferences(accountID string) (*DiffPreferencesInfo, *Response, error)

GetDiffPreferences retrieves the diff preferences of a user.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-diff-preferences

func (*AccountsService) GetGPGKey Uses

func (s *AccountsService) GetGPGKey(accountID, gpgKeyID string) (*GpgKeyInfo, *Response, error)

GetGPGKey retrieves a GPG key of a user.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-gpg-key

func (*AccountsService) GetHTTPPassword Uses

func (s *AccountsService) GetHTTPPassword(accountID string) (string, *Response, error)

GetHTTPPassword retrieves the HTTP password of an account.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-http-password

func (*AccountsService) GetSSHKey Uses

func (s *AccountsService) GetSSHKey(accountID, sshKeyID string) (*SSHKeyInfo, *Response, error)

GetSSHKey retrieves an SSH key of a user.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-ssh-key

func (*AccountsService) GetStarredChanges Uses

func (s *AccountsService) GetStarredChanges(accountID string) (*[]ChangeInfo, *Response, error)

GetStarredChanges gets the changes starred by the identified user account. This URL endpoint is functionally identical to the changes query GET /changes/?q=is:starred.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-starred-changes

func (*AccountsService) GetUserPreferences Uses

func (s *AccountsService) GetUserPreferences(accountID string) (*PreferencesInfo, *Response, error)

GetUserPreferences retrieves the user’s preferences.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-user-preferences

func (*AccountsService) GetUsername Uses

func (s *AccountsService) GetUsername(accountID string) (string, *Response, error)

GetUsername retrieves the username of an account.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-username

func (*AccountsService) ListAccountCapabilities Uses

func (s *AccountsService) ListAccountCapabilities(accountID string, opt *CapabilityOptions) (*AccountCapabilityInfo, *Response, error)

ListAccountCapabilities returns the global capabilities that are enabled for the specified user. If the global capabilities for the calling user should be listed, self can be used as account-id. This can be used by UI tools to discover if administrative features are available to the caller, so they can hide (or show) relevant UI actions.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#list-account-capabilities

func (*AccountsService) ListAccountEmails Uses

func (s *AccountsService) ListAccountEmails(accountID string) (*[]EmailInfo, *Response, error)

ListAccountEmails returns the email addresses that are configured for the specified user.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#list-account-emails

func (*AccountsService) ListGPGKeys Uses

func (s *AccountsService) ListGPGKeys(accountID string) (*map[string]GpgKeyInfo, *Response, error)

ListGPGKeys returns the GPG keys of an account.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#list-gpg-keys

func (*AccountsService) ListGroups Uses

func (s *AccountsService) ListGroups(accountID string) (*[]GroupInfo, *Response, error)

ListGroups lists all groups that contain the specified user as a member.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#list-groups

func (*AccountsService) ListSSHKeys Uses

func (s *AccountsService) ListSSHKeys(accountID string) (*[]SSHKeyInfo, *Response, error)

ListSSHKeys returns the SSH keys of an account.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#list-ssh-keys

func (*AccountsService) SetAccountName Uses

func (s *AccountsService) SetAccountName(accountID string, input *AccountNameInput) (*string, *Response, error)

SetAccountName sets the full name of an account. The new account name must be provided in the request body inside an AccountNameInput entity.

As response the new account name is returned. If the name was deleted the response is “204 No Content”. Some realms may not allow to modify the account name. In this case the request is rejected with “405 Method Not Allowed”.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#set-account-name

func (*AccountsService) SetActive Uses

func (s *AccountsService) SetActive(accountID string) (*Response, error)

SetActive sets the account state to active.

If the account was already active the response is “200 OK”.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#set-active

func (*AccountsService) SetDiffPreferences Uses

func (s *AccountsService) SetDiffPreferences(accountID string, input *DiffPreferencesInput) (*DiffPreferencesInfo, *Response, error)

SetDiffPreferences sets the diff preferences of a user. The new diff preferences must be provided in the request body as a DiffPreferencesInput entity.

As result the new diff preferences of the user are returned as a DiffPreferencesInfo entity.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#set-diff-preferences

func (*AccountsService) SetHTTPPassword Uses

func (s *AccountsService) SetHTTPPassword(accountID string, input *HTTPPasswordInput) (*string, *Response, error)

SetHTTPPassword sets/Generates the HTTP password of an account. The options for setting/generating the HTTP password must be provided in the request body inside a HTTPPasswordInput entity.

As response the new HTTP password is returned. If the HTTP password was deleted the response is “204 No Content”.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#set-http-password

func (*AccountsService) SetPreferredEmail Uses

func (s *AccountsService) SetPreferredEmail(accountID, emailID string) (*Response, error)

SetPreferredEmail sets an email address as preferred email address for an account.

If the email address was already the preferred email address of the account the response is “200 OK”.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#set-preferred-email

func (*AccountsService) SetUserPreferences Uses

func (s *AccountsService) SetUserPreferences(accountID string, input *PreferencesInput) (*PreferencesInfo, *Response, error)

SetUserPreferences sets the user’s preferences. The new preferences must be provided in the request body as a PreferencesInput entity.

As result the new preferences of the user are returned as a PreferencesInfo entity.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#set-user-preferences

func (*AccountsService) SetUsername Uses

func (s *AccountsService) SetUsername(accountID string, input *UsernameInput) (*string, *Response, error)

SetUsername sets a new username. The new username must be provided in the request body inside a UsernameInput entity. Once set, the username cannot be changed or deleted. If attempted this fails with “405 Method Not Allowed”.

As response the new username is returned.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#set-username

func (*AccountsService) StarChange Uses

func (s *AccountsService) StarChange(accountID, changeID string) (*Response, error)

StarChange star a change. Starred changes are returned for the search query is:starred or starredby:USER and automatically notify the user whenever updates are made to the change.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#star-change

func (*AccountsService) SuggestAccount Uses

func (s *AccountsService) SuggestAccount(opt *QueryOptions) (*[]AccountInfo, *Response, error)

SuggestAccount suggests users for a given query q and result limit n. If result limit is not passed, then the default 10 is used. Returns a list of matching AccountInfo entities.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#query-account

func (*AccountsService) UnstarChange Uses

func (s *AccountsService) UnstarChange(accountID, changeID string) (*Response, error)

UnstarChange nstar a change. Removes the starred flag, stopping notifications.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#unstar-change

type ActionInfo Uses

type ActionInfo struct {
    Method  string `json:"method,omitempty"`
    Label   string `json:"label,omitempty"`
    Title   string `json:"title,omitempty"`
    Enabled bool   `json:"enabled,omitempty"`
}

ActionInfo entity describes a REST API call the client can make to manipulate a resource. These are frequently implemented by plugins and may be discovered at runtime.

type AddReviewerResult Uses

type AddReviewerResult struct {
    Input     string         `json:"input,omitempty"`
    Reviewers []ReviewerInfo `json:"reviewers,omitempty"`
    CCS       []ReviewerInfo `json:"ccs,omitempty"`
    Error     string         `json:"error,omitempty"`
    Confirm   bool           `json:"confirm,omitempty"`
}

AddReviewerResult entity describes the result of adding a reviewer to a change.

type ApprovalInfo Uses

type ApprovalInfo struct {
    AccountInfo
    Value int    `json:"value,omitempty"`
    Date  string `json:"date,omitempty"`
}

ApprovalInfo entity contains information about an approval from a user for a label on a change.

type AuthInfo Uses

type AuthInfo struct {
    Type                     string   `json:"type"`
    UseContributorAgreements bool     `json:"use_contributor_agreements,omitempty"`
    EditableAccountFields    []string `json:"editable_account_fields"`
    LoginURL                 string   `json:"login_url,omitempty"`
    LoginText                string   `json:"login_text,omitempty"`
    SwitchAccountURL         string   `json:"switch_account_url,omitempty"`
    RegisterURL              string   `json:"register_url,omitempty"`
    RegisterText             string   `json:"register_text,omitempty"`
    EditFullNameURL          string   `json:"edit_full_name_url,omitempty"`
    HTTPPasswordURL          string   `json:"http_password_url,omitempty"`
    IsGitBasicAuth           bool     `json:"is_git_basic_auth,omitempty"`
}

AuthInfo entity contains information about the authentication configuration of the Gerrit server.

type AuthenticationService Uses

type AuthenticationService struct {
    // contains filtered or unexported fields
}

AuthenticationService contains Authentication related functions.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api.html#authentication

func (*AuthenticationService) HasAuth Uses

func (s *AuthenticationService) HasAuth() bool

HasAuth checks if an auth type is used

func (*AuthenticationService) HasBasicAuth Uses

func (s *AuthenticationService) HasBasicAuth() bool

HasBasicAuth checks if the auth type is HTTP Basic auth

func (*AuthenticationService) HasCookieAuth Uses

func (s *AuthenticationService) HasCookieAuth() bool

HasCookieAuth checks if the auth type is HTTP Cookie based

func (*AuthenticationService) HasDigestAuth Uses

func (s *AuthenticationService) HasDigestAuth() bool

HasDigestAuth checks if the auth type is HTTP Digest based

func (*AuthenticationService) ResetAuth Uses

func (s *AuthenticationService) ResetAuth()

ResetAuth resets all former authentification settings

func (*AuthenticationService) SetBasicAuth Uses

func (s *AuthenticationService) SetBasicAuth(username, password string)

SetBasicAuth sets basic parameters for HTTP Basic auth

func (*AuthenticationService) SetCookieAuth Uses

func (s *AuthenticationService) SetCookieAuth(name, value string)

SetCookieAuth sets basic parameters for HTTP Cookie

func (*AuthenticationService) SetDigestAuth Uses

func (s *AuthenticationService) SetDigestAuth(username, password string)

SetDigestAuth sets digest parameters for HTTP Digest auth.

type BanInput Uses

type BanInput struct {
    Commits []string `json:"commits"`
    Reason  string   `json:"reason,omitempty"`
}

BanInput entity contains information for banning commits in a project.

type BanResultInfo Uses

type BanResultInfo struct {
    NewlyBanned   []string `json:"newly_banned,omitempty"`
    AlreadyBanned []string `json:"already_banned,omitempty"`
    Ignored       []string `json:"ignored,omitempty"`
}

BanResultInfo entity describes the result of banning commits.

type BranchInfo Uses

type BranchInfo struct {
    Ref       string        `json:"ref"`
    Revision  string        `json:"revision"`
    CanDelete bool          `json:"can_delete"`
    WebLinks  []WebLinkInfo `json:"web_links,omitempty"`
}

BranchInfo entity contains information about a branch.

type BranchInput Uses

type BranchInput struct {
    Ref      string `json:"ref,omitempty"`
    Revision string `json:"revision,omitempty"`
}

BranchInput entity contains information for the creation of a new branch.

type BranchOptions Uses

type BranchOptions struct {
    // Limit the number of branches to be included in the results.
    Limit int `url:"n,omitempty"`

    // Skip the given number of branches from the beginning of the list.
    Skip string `url:"s,omitempty"`

    // Substring limits the results to those projects that match the specified substring.
    Substring string `url:"m,omitempty"`

    // Limit the results to those branches that match the specified regex.
    // Boundary matchers '^' and '$' are implicit.
    // For example: the regex 't*' will match any branches that start with 'test' and regex '*t' will match any branches that end with 'test'.
    Regex string `url:"r,omitempty"`
}

BranchOptions specifies the parameters to the branch API endpoints.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#branch-options

type CacheInfo Uses

type CacheInfo struct {
    Name       string       `json:"name,omitempty"`
    Type       string       `json:"type"`
    Entries    EntriesInfo  `json:"entries"`
    AverageGet string       `json:"average_get,omitempty"`
    HitRatio   HitRatioInfo `json:"hit_ratio"`
}

CacheInfo entity contains information about a cache.

type CacheOperationInput Uses

type CacheOperationInput struct {
    Operation string   `json:"operation"`
    Caches    []string `json:"caches,omitempty"`
}

CacheOperationInput entity contains information about an operation that should be executed on caches.

type CapabilityOptions Uses

type CapabilityOptions struct {
    // To filter the set of global capabilities the q parameter can be used.
    // Filtering may decrease the response time by avoiding looking at every possible alternative for the caller.
    Filter []string `url:"q,omitempty"`
}

CapabilityOptions specifies the parameters to filter for capabilities.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#list-account-capabilities

type ChangeConfigInfo Uses

type ChangeConfigInfo struct {
    AllowDrafts      bool   `json:"allow_drafts,omitempty"`
    LargeChange      int    `json:"large_change"`
    ReplyLabel       string `json:"reply_label"`
    ReplyTooltip     string `json:"reply_tooltip"`
    UpdateDelay      int    `json:"update_delay"`
    SubmitWholeTopic bool   `json:"submit_whole_topic"`
}

ChangeConfigInfo entity contains information about Gerrit configuration from the change section.

type ChangeEditDetailOptions Uses

type ChangeEditDetailOptions struct {
    // When request parameter list is provided the response also includes the file list.
    List bool `url:"list,omitempty"`
    // When base request parameter is provided the file list is computed against this base revision.
    Base bool `url:"base,omitempty"`
    // When request parameter download-commands is provided fetch info map is also included.
    DownloadCommands bool `url:"download-commands,omitempty"`
}

ChangeEditDetailOptions specifies the parameters to the ChangesService.GetChangeEditDetails.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-edit-detail

type ChangeEditInput Uses

type ChangeEditInput struct {
    RestorePath string `json:"restore_path,omitempty"`
    OldPath     string `json:"old_path,omitempty"`
    NewPath     string `json:"new_path,omitempty"`
}

ChangeEditInput entity contains information for restoring a path within change edit.

type ChangeEditMessageInput Uses

type ChangeEditMessageInput struct {
    Message string `json:"message"`
}

ChangeEditMessageInput entity contains information for changing the commit message within a change edit.

type ChangeInfo Uses

type ChangeInfo struct {
    ID                 string                   `json:"id"`
    URL                string                   `json:"url,omitempty"`
    Project            string                   `json:"project"`
    Branch             string                   `json:"branch"`
    Topic              string                   `json:"topic,omitempty"`
    ChangeID           string                   `json:"change_id"`
    Subject            string                   `json:"subject"`
    Status             string                   `json:"status"`
    Created            Timestamp                `json:"created"`
    Updated            Timestamp                `json:"updated"`
    Submitted          *Timestamp               `json:"submitted,omitempty"`
    Starred            bool                     `json:"starred,omitempty"`
    Reviewed           bool                     `json:"reviewed,omitempty"`
    Mergeable          bool                     `json:"mergeable,omitempty"`
    Insertions         int                      `json:"insertions"`
    Deletions          int                      `json:"deletions"`
    Number             int                      `json:"_number"`
    Owner              AccountInfo              `json:"owner"`
    Actions            map[string]ActionInfo    `json:"actions,omitempty"`
    Labels             map[string]LabelInfo     `json:"labels,omitempty"`
    PermittedLabels    map[string][]string      `json:"permitted_labels,omitempty"`
    RemovableReviewers []AccountInfo            `json:"removable_reviewers,omitempty"`
    Reviewers          map[string][]AccountInfo `json:"reviewers,omitempty"`
    Messages           []ChangeMessageInfo      `json:"messages,omitempty"`
    CurrentRevision    string                   `json:"current_revision,omitempty"`
    Revisions          map[string]RevisionInfo  `json:"revisions,omitempty"`
    MoreChanges        bool                     `json:"_more_changes,omitempty"`
    Problems           []ProblemInfo            `json:"problems,omitempty"`
    BaseChange         string                   `json:"base_change,omitempty"`
}

ChangeInfo entity contains information about a change.

type ChangeMessageInfo Uses

type ChangeMessageInfo struct {
    ID             string      `json:"id"`
    Author         AccountInfo `json:"author,omitempty"`
    Date           Timestamp   `json:"date"`
    Message        string      `json:"message"`
    Tag            string      `json:"tag,omitempty"`
    RevisionNumber int         `json:"_revision_number,omitempty"`
}

ChangeMessageInfo entity contains information about a message attached to a change.

type ChangeOptions Uses

type ChangeOptions struct {
    // Additional fields can be obtained by adding o parameters, each option requires more database lookups and slows down the query response time to the client so they are generally disabled by default.
    //
    // Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-changes
    AdditionalFields []string `url:"o,omitempty"`
}

ChangeOptions specifies the parameters for Query changes.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-changes

type ChangesService Uses

type ChangesService struct {
    // contains filtered or unexported fields
}

ChangesService contains Change related REST endpoints

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html

func (*ChangesService) AbandonChange Uses

func (s *ChangesService) AbandonChange(changeID string, input *AbandonInput) (*ChangeInfo, *Response, error)

AbandonChange abandons a change.

The request body does not need to include a AbandonInput entity if no review comment is added.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#abandon-change

func (*ChangesService) AddReviewer Uses

func (s *ChangesService) AddReviewer(changeID string, input *ReviewerInput) (*AddReviewerResult, *Response, error)

AddReviewer adds one user or all members of one group as reviewer to the change. The reviewer to be added to the change must be provided in the request body as a ReviewerInput entity.

As response an AddReviewerResult entity is returned that describes the newly added reviewers. If a group is specified, adding the group members as reviewers is an atomic operation. This means if an error is returned, none of the members are added as reviewer. If a group with many members is added as reviewer a confirmation may be required.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#add-reviewer

func (*ChangesService) ChangeCommitMessageInChangeEdit Uses

func (s *ChangesService) ChangeCommitMessageInChangeEdit(changeID string, input *ChangeEditMessageInput) (*Response, error)

ChangeCommitMessageInChangeEdit modify commit message. The request body needs to include a ChangeEditMessageInput entity.

If a change edit doesn’t exist for this change yet, it is created. As response “204 No Content” is returned.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#put-change-edit-message

func (*ChangesService) ChangeFileContentInChangeEdit Uses

func (s *ChangesService) ChangeFileContentInChangeEdit(changeID, filePath, content string) (*Response, error)

ChangeFileContentInChangeEdit put content of a file to a change edit.

When change edit doesn’t exist for this change yet it is created. When file content isn’t provided, it is wiped out for that file. As response “204 No Content” is returned.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#put-edit-file

func (*ChangesService) ChangesSubmittedTogether Uses

func (s *ChangesService) ChangesSubmittedTogether(changeID string) (*[]ChangeInfo, *Response, error)

ChangesSubmittedTogether returns a list of all changes which are submitted when {submit} is called for this change, including the current change itself. An empty list is returned if this change will be submitted by itself (no other changes).

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#submitted_together

func (*ChangesService) CheckChange Uses

func (s *ChangesService) CheckChange(changeID string) (*ChangeInfo, *Response, error)

CheckChange performs consistency checks on the change, and returns a ChangeInfo entity with the problems field set to a list of ProblemInfo entities. Depending on the type of problem, some fields not marked optional may be missing from the result. At least id, project, branch, and _number will be present.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#check-change

func (*ChangesService) CherryPickRevision Uses

func (s *ChangesService) CherryPickRevision(changeID, revisionID string, input *CherryPickInput) (*ChangeInfo, *Response, error)

CherryPickRevision cherry picks a revision to a destination branch. The commit message and destination branch must be provided in the request body inside a CherryPickInput entity.

As response a ChangeInfo entity is returned that describes the resulting cherry picked change.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#cherry-pick

func (*ChangesService) CreateChange Uses

func (s *ChangesService) CreateChange(input *ChangeInfo) (*ChangeInfo, *Response, error)

CreateChange creates a new change. The change info ChangeInfo entity must be provided in the request body. Only the following attributes are honored: project, branch, subject, status and topic. The first three attributes are mandatory. Valid values for status are: DRAFT and NEW.

As response a ChangeInfo entity is returned that describes the resulting change.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#create-change

func (*ChangesService) CreateDraft Uses

func (s *ChangesService) CreateDraft(changeID, revisionID string, input *CommentInput) (*CommentInfo, *Response, error)

CreateDraft creates a draft comment on a revision. The new draft comment must be provided in the request body inside a CommentInput entity.

As response a CommentInfo entity is returned that describes the draft comment.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#create-draft

func (*ChangesService) DeleteChangeEdit Uses

func (s *ChangesService) DeleteChangeEdit(changeID string) (*Response, error)

DeleteChangeEdit deletes change edit.

As response “204 No Content” is returned.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-edit

func (*ChangesService) DeleteDraft Uses

func (s *ChangesService) DeleteDraft(changeID, revisionID, draftID string) (*Response, error)

DeleteDraft deletes a draft comment from a revision.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-draft

func (*ChangesService) DeleteDraftChange Uses

func (s *ChangesService) DeleteDraftChange(changeID string) (*Response, error)

DeleteDraftChange deletes a draft change.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-draft-change

func (*ChangesService) DeleteDraftRevision Uses

func (s *ChangesService) DeleteDraftRevision(changeID, revisionID string) (*Response, error)

DeleteDraftRevision deletes a draft revision.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-draft-revision

func (*ChangesService) DeleteFileInChangeEdit Uses

func (s *ChangesService) DeleteFileInChangeEdit(changeID, filePath string) (*Response, error)

DeleteFileInChangeEdit deletes a file from a change edit. This deletes the file from the repository completely. This is not the same as reverting or restoring a file to its previous contents.

When change edit doesn’t exist for this change yet it is created.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-edit-file

func (*ChangesService) DeleteReviewed Uses

func (s *ChangesService) DeleteReviewed(changeID, revisionID, fileID string) (*Response, error)

DeleteReviewed deletes the reviewed flag of the calling user from a file of a revision.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-reviewed

func (*ChangesService) DeleteReviewer Uses

func (s *ChangesService) DeleteReviewer(changeID, accountID string) (*Response, error)

DeleteReviewer deletes a reviewer from a change.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-reviewer

func (*ChangesService) DeleteTopic Uses

func (s *ChangesService) DeleteTopic(changeID string) (*Response, error)

DeleteTopic deletes the topic of a change. The request body does not need to include a TopicInput entity if no review comment is added.

Please note that some proxies prohibit request bodies for DELETE requests. In this case, if you want to specify a commit message, use PUT to delete the topic.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-topic

func (*ChangesService) DeleteVote Uses

func (s *ChangesService) DeleteVote(changeID string, accountID string, label string, input *DeleteVoteInput) (*Response, error)

DeleteVote deletes a single vote from a change. Note, that even when the last vote of a reviewer is removed the reviewer itself is still listed on the change.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-vote

func (*ChangesService) FixChange Uses

func (s *ChangesService) FixChange(changeID string, input *FixInput) (*ChangeInfo, *Response, error)

FixChange performs consistency checks on the change as with GET /check, and additionally fixes any problems that can be fixed automatically. The returned field values reflect any fixes.

Some fixes have options controlling their behavior, which can be set in the FixInput entity body. Only the change owner, a project owner, or an administrator may fix changes.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#fix-change

func (*ChangesService) GetChange Uses

func (s *ChangesService) GetChange(changeID string, opt *ChangeOptions) (*ChangeInfo, *Response, error)

GetChange retrieves a change. Additional fields can be obtained by adding o parameters, each option requires more database lookups and slows down the query response time to the client so they are generally disabled by default.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-change

func (*ChangesService) GetChangeDetail Uses

func (s *ChangesService) GetChangeDetail(changeID string, opt *ChangeOptions) (*ChangeInfo, *Response, error)

GetChangeDetail retrieves a change with labels, detailed labels, detailed accounts, and messages. Additional fields can be obtained by adding o parameters, each option requires more database lookups and slows down the query response time to the client so they are generally disabled by default.

This response will contain all votes for each label and include one combined vote. The combined label vote is calculated in the following order (from highest to lowest): REJECTED > APPROVED > DISLIKED > RECOMMENDED.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-change-detail

func (*ChangesService) GetChangeEditDetails Uses

func (s *ChangesService) GetChangeEditDetails(changeID string, opt *ChangeEditDetailOptions) (*EditInfo, *Response, error)

GetChangeEditDetails retrieves a change edit details. As response an EditInfo entity is returned that describes the change edit, or “204 No Content” when change edit doesn’t exist for this change. Change edits are stored on special branches and there can be max one edit per user per change. Edits aren’t tracked in the database.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-edit-detail

func (*ChangesService) GetComment Uses

func (s *ChangesService) GetComment(changeID, revisionID, commentID string) (*CommentInfo, *Response, error)

GetComment retrieves a published comment of a revision.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-comment

func (*ChangesService) GetCommit Uses

func (s *ChangesService) GetCommit(changeID, revisionID string, opt *CommitOptions) (*CommitInfo, *Response, error)

GetCommit retrieves a parsed commit of a revision.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-commit

func (*ChangesService) GetContent Uses

func (s *ChangesService) GetContent(changeID, revisionID, fileID string) (*string, *Response, error)

GetContent gets the content of a file from a certain revision. The content is returned as base64 encoded string. The HTTP response Content-Type is always text/plain, reflecting the base64 wrapping. A Gerrit-specific X-FYI-Content-Type header is returned describing the server detected content type of the file.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-content

func (*ChangesService) GetContentType Uses

func (s *ChangesService) GetContentType(changeID, revisionID, fileID string) (*Response, error)

GetContentType gets the content type of a file from a certain revision. This is nearly the same as GetContent. But if only the content type is required, callers should use HEAD to avoid downloading the encoded file contents.

For further documentation see GetContent.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-content

func (*ChangesService) GetDiff Uses

func (s *ChangesService) GetDiff(changeID, revisionID, fileID string, opt *DiffOptions) (*DiffInfo, *Response, error)

GetDiff gets the diff of a file from a certain revision.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-diff

func (*ChangesService) GetDraft Uses

func (s *ChangesService) GetDraft(changeID, revisionID, draftID string) (*CommentInfo, *Response, error)

GetDraft retrieves a draft comment of a revision that belongs to the calling user.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-draft

func (*ChangesService) GetIncludedIn Uses

func (s *ChangesService) GetIncludedIn(changeID string) (*IncludedInInfo, *Response, error)

GetIncludedIn retrieves the branches and tags in which a change is included.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-included-in

func (*ChangesService) GetMergeable Uses

func (s *ChangesService) GetMergeable(changeID, revisionID string, opt *MergableOptions) (*MergeableInfo, *Response, error)

GetMergeable gets the method the server will use to submit (merge) the change and an indicator if the change is currently mergeable.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-mergeable

func (*ChangesService) GetPatch Uses

func (s *ChangesService) GetPatch(changeID, revisionID string, opt *PatchOptions) (*string, *Response, error)

GetPatch gets the formatted patch for one revision.

The formatted patch is returned as text encoded inside base64. Adding query parameter zip (for example /changes/.../patch?zip) returns the patch as a single file inside of a ZIP archive. Clients can expand the ZIP to obtain the plain text patch, avoiding the need for a base64 decoding step. This option implies download.

Query parameter download (e.g. /changes/.../patch?download) will suggest the browser save the patch as commitsha1.diff.base64, for later processing by command line tools.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-patch

func (*ChangesService) GetRelatedChanges Uses

func (s *ChangesService) GetRelatedChanges(changeID, revisionID string) (*RelatedChangesInfo, *Response, error)

GetRelatedChanges retrieves related changes of a revision. Related changes are changes that either depend on, or are dependencies of the revision.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-related-changes

func (*ChangesService) GetReview Uses

func (s *ChangesService) GetReview(changeID, revisionID string) (*ChangeInfo, *Response, error)

GetReview retrieves a review of a revision.

As response a ChangeInfo entity with detailed labels and detailed accounts is returned that describes the review of the revision. The revision for which the review is retrieved is contained in the revisions field. In addition the current_revision field is set if the revision for which the review is retrieved is the current revision of the change. Please note that the returned labels are always for the current patch set.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-review

func (*ChangesService) GetReviewer Uses

func (s *ChangesService) GetReviewer(changeID, accountID string) (*ReviewerInfo, *Response, error)

GetReviewer retrieves a reviewer of a change.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-reviewer

func (*ChangesService) GetRevisionActions Uses

func (s *ChangesService) GetRevisionActions(changeID, revisionID string) (*map[string]ActionInfo, *Response, error)

GetRevisionActions retrieves revision actions of the revision of a change.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-revision-actions

func (*ChangesService) GetSubmitType Uses

func (s *ChangesService) GetSubmitType(changeID, revisionID string) (string, *Response, error)

GetSubmitType gets the method the server will use to submit (merge) the change.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-submit-type

func (*ChangesService) GetTopic Uses

func (s *ChangesService) GetTopic(changeID string) (string, *Response, error)

GetTopic retrieves the topic of a change.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-topic

func (*ChangesService) IndexChange Uses

func (s *ChangesService) IndexChange(changeID string) (*Response, error)

IndexChange adds or updates the change in the secondary index.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#index-change

func (*ChangesService) ListChangeComments Uses

func (s *ChangesService) ListChangeComments(changeID string) (*map[string][]CommentInfo, *Response, error)

ListChangeComments lists the published comments of all revisions of the change. The entries in the map are sorted by file path, and the comments for each path are sorted by patch set number. Each comment has the patch_set and author fields set.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-change-comments

func (*ChangesService) ListChangeDrafts Uses

func (s *ChangesService) ListChangeDrafts(changeID string) (*map[string][]CommentInfo, *Response, error)

ListChangeDrafts lLists the draft comments of all revisions of the change that belong to the calling user. The entries in the map are sorted by file path, and the comments for each path are sorted by patch set number. Each comment has the patch_set field set, and no author.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-change-drafts

func (*ChangesService) ListFiles Uses

func (s *ChangesService) ListFiles(changeID, revisionID string, opt *FilesOptions) (map[string]FileInfo, *Response, error)

ListFiles lists the files that were modified, added or deleted in a revision. As result a map is returned that maps the file path to a list of FileInfo entries. The entries in the map are sorted by file path.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-files

func (*ChangesService) ListFilesReviewed Uses

func (s *ChangesService) ListFilesReviewed(changeID, revisionID string, opt *FilesOptions) ([]string, *Response, error)

ListFilesReviewed lists the files that were modified, added or deleted in a revision. Unlike ListFiles, the response of ListFilesReviewed is a list of the paths the caller has marked as reviewed. Clients that also need the FileInfo should make two requests.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-files

func (*ChangesService) ListReviewers Uses

func (s *ChangesService) ListReviewers(changeID string) (*[]ReviewerInfo, *Response, error)

ListReviewers lists the reviewers of a change.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-reviewers

func (*ChangesService) ListRevisionComments Uses

func (s *ChangesService) ListRevisionComments(changeID, revisionID string) (*map[string][]CommentInfo, *Response, error)

ListRevisionComments lists the published comments of a revision. As result a map is returned that maps the file path to a list of CommentInfo entries. The entries in the map are sorted by file path and only include file (or inline) comments. Use the Get Change Detail endpoint to retrieve the general change message (or comment).

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-comments

func (*ChangesService) ListRevisionDrafts Uses

func (s *ChangesService) ListRevisionDrafts(changeID, revisionID string) (*map[string][]CommentInfo, *Response, error)

ListRevisionDrafts lists the draft comments of a revision that belong to the calling user. Returns a map of file paths to lists of CommentInfo entries. The entries in the map are sorted by file path.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-drafts

func (*ChangesService) ListVotes Uses

func (s *ChangesService) ListVotes(changeID string, accountID string) (map[string]int, *Response, error)

ListVotes lists the votes for a specific reviewer of the change.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-votes

func (*ChangesService) PublishChangeEdit Uses

func (s *ChangesService) PublishChangeEdit(changeID, notify string) (*Response, error)

PublishChangeEdit promotes change edit to a regular patch set.

As response “204 No Content” is returned.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#publish-edit

Code:

ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
    fmt.Fprintf(w, "ok")
}))
defer ts.Close()

client, err := gerrit.NewClient(ts.URL, nil)
if err != nil {
    panic(err)
}

_, err = client.Changes.PublishChangeEdit("123", "NONE")
if err != nil {
    panic(err)
}

func (*ChangesService) PublishDraftChange Uses

func (s *ChangesService) PublishDraftChange(changeID, notify string) (*Response, error)

PublishDraftChange publishes a draft change.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#publish-draft-change

func (*ChangesService) PublishDraftRevision Uses

func (s *ChangesService) PublishDraftRevision(changeID, revisionID string) (*Response, error)

PublishDraftRevision publishes a draft revision.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#publish-draft-revision

func (*ChangesService) QueryChanges Uses

func (s *ChangesService) QueryChanges(opt *QueryChangeOptions) (*[]ChangeInfo, *Response, error)

QueryChanges lists changes visible to the caller. The query string must be provided by the q parameter. The n parameter can be used to limit the returned results.

The change output is sorted by the last update time, most recently updated to oldest updated.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-changes

Code:

instance := "https://android-review.googlesource.com/"
client, err := gerrit.NewClient(instance, nil)
if err != nil {
    panic(err)
}

opt := &gerrit.QueryChangeOptions{}
opt.Query = []string{
    "change:249244",
}
opt.Limit = 2
opt.AdditionalFields = []string{"LABELS"}
changes, _, err := client.Changes.QueryChanges(opt)
if err != nil {
    panic(err)
}

for _, change := range *changes {
    fmt.Printf("Project: %s -> %s -> %s%d\n", change.Project, change.Subject, instance, change.Number)
}

Output:

Project: platform/art -> ART: Change return types of field access entrypoints -> https://android-review.googlesource.com/249244

Prior to fixing #18 this test would fail.

Code:

instance := "https://android-review.googlesource.com/"
client, err := gerrit.NewClient(instance, nil)
if err != nil {
    panic(err)
}

opt := &gerrit.QueryChangeOptions{}
opt.Query = []string{
    "change:249244+status:merged",
}
opt.Limit = 2
opt.AdditionalFields = []string{"LABELS"}
changes, _, err := client.Changes.QueryChanges(opt)
if err != nil {
    panic(err)
}

for _, change := range *changes {
    fmt.Printf("Project: %s -> %s -> %s%d\n", change.Project, change.Subject, instance, change.Number)
}

Output:

Project: platform/art -> ART: Change return types of field access entrypoints -> https://android-review.googlesource.com/249244

func (*ChangesService) RebaseChange Uses

func (s *ChangesService) RebaseChange(changeID string, input *RebaseInput) (*ChangeInfo, *Response, error)

RebaseChange rebases a change.

Optionally, the parent revision can be changed to another patch set through the RebaseInput entity.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#rebase-change

func (*ChangesService) RebaseChangeEdit Uses

func (s *ChangesService) RebaseChangeEdit(changeID string) (*Response, error)

RebaseChangeEdit rebases change edit on top of latest patch set.

When change was rebased on top of latest patch set, response “204 No Content” is returned. When change edit is already based on top of the latest patch set, the response “409 Conflict” is returned.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#rebase-edit

func (*ChangesService) RestoreChange Uses

func (s *ChangesService) RestoreChange(changeID string, input *RestoreInput) (*ChangeInfo, *Response, error)

RestoreChange restores a change.

The request body does not need to include a RestoreInput entity if no review comment is added.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#restore-change

func (*ChangesService) RetrieveCommitMessageFromChangeEdit Uses

func (s *ChangesService) RetrieveCommitMessageFromChangeEdit(changeID string) (string, *Response, error)

RetrieveCommitMessageFromChangeEdit retrieves commit message from change edit. The commit message is returned as base64 encoded string.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-edit-message

func (*ChangesService) RetrieveFileContentFromChangeEdit Uses

func (s *ChangesService) RetrieveFileContentFromChangeEdit(changeID, filePath string) (*string, *Response, error)

RetrieveFileContentFromChangeEdit retrieves content of a file from a change edit.

The content of the file is returned as text encoded inside base64. The Content-Type header will always be text/plain reflecting the outer base64 encoding. A Gerrit-specific X-FYI-Content-Type header can be examined to find the server detected content type of the file.

When the specified file was deleted in the change edit “204 No Content” is returned. If only the content type is required, callers should use HEAD to avoid downloading the encoded file contents.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-edit-file

func (*ChangesService) RetrieveFileContentTypeFromChangeEdit Uses

func (s *ChangesService) RetrieveFileContentTypeFromChangeEdit(changeID, filePath string) (*Response, error)

RetrieveFileContentTypeFromChangeEdit retrieves content type of a file from a change edit. This is nearly the same as RetrieveFileContentFromChangeEdit. But if only the content type is required, callers should use HEAD to avoid downloading the encoded file contents.

For further documentation please have a look at RetrieveFileContentFromChangeEdit.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-edit-file

func (*ChangesService) RetrieveMetaDataOfAFileFromChangeEdit Uses

func (s *ChangesService) RetrieveMetaDataOfAFileFromChangeEdit(changeID, filePath string) (*EditFileInfo, *Response, error)

RetrieveMetaDataOfAFileFromChangeEdit retrieves meta data of a file from a change edit. Currently only web links are returned.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-edit-meta-data

func (*ChangesService) RevertChange Uses

func (s *ChangesService) RevertChange(changeID string, input *RevertInput) (*ChangeInfo, *Response, error)

RevertChange reverts a change.

The request body does not need to include a RevertInput entity if no review comment is added.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#revert-change

func (*ChangesService) SetReview Uses

func (s *ChangesService) SetReview(changeID, revisionID string, input *ReviewInput) (*ReviewResult, *Response, error)

SetReview sets a review on a revision. The review must be provided in the request body as a ReviewInput entity.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#set-review

func (*ChangesService) SetReviewed Uses

func (s *ChangesService) SetReviewed(changeID, revisionID, fileID string) (*Response, error)

SetReviewed marks a file of a revision as reviewed by the calling user.

If the file was already marked as reviewed by the calling user the response is “200 OK”.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#set-reviewed

func (*ChangesService) SetTopic Uses

func (s *ChangesService) SetTopic(changeID string, input *TopicInput) (*string, *Response, error)

SetTopic sets the topic of a change. The new topic must be provided in the request body inside a TopicInput entity.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#set-topic

func (*ChangesService) SubmitChange Uses

func (s *ChangesService) SubmitChange(changeID string, input *SubmitInput) (*ChangeInfo, *Response, error)

SubmitChange submits a change.

The request body only needs to include a SubmitInput entity if submitting on behalf of another user.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#submit-change

func (*ChangesService) SuggestReviewers Uses

func (s *ChangesService) SuggestReviewers(changeID string, opt *QueryOptions) (*[]SuggestedReviewerInfo, *Response, error)

SuggestReviewers suggest the reviewers for a given query q and result limit n. If result limit is not passed, then the default 10 is used.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#suggest-reviewers

func (*ChangesService) TestSubmitRule Uses

func (s *ChangesService) TestSubmitRule(changeID, revisionID string, input *RuleInput) (*[]SubmitRecord, *Response, error)

TestSubmitRule tests the submit_rule Prolog rule in the project, or the one given.

Request body may be either the Prolog code as text/plain or a RuleInput object. The query parameter filters may be set to SKIP to bypass parent project filters while testing a project-specific rule.

The response is a list of SubmitRecord entries describing the permutations that satisfy the tested submit rule.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#test-submit-rule

func (*ChangesService) TestSubmitType Uses

func (s *ChangesService) TestSubmitType(changeID, revisionID string, input *RuleInput) (*string, *Response, error)

TestSubmitType tests the submit_type Prolog rule in the project, or the one given.

Request body may be either the Prolog code as text/plain or a RuleInput object. The query parameter filters may be set to SKIP to bypass parent project filters while testing a project-specific rule.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#test-submit-type

func (*ChangesService) UpdateDraft Uses

func (s *ChangesService) UpdateDraft(changeID, revisionID, draftID string, input *CommentInput) (*CommentInfo, *Response, error)

UpdateDraft updates a draft comment on a revision. The new draft comment must be provided in the request body inside a CommentInput entity.

As response a CommentInfo entity is returned that describes the draft comment.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#update-draft

type CherryPickInput Uses

type CherryPickInput struct {
    Message     string `json:"message"`
    Destination string `json:"destination"`
}

CherryPickInput entity contains information for cherry-picking a change to a new branch.

type ChildProjectOptions Uses

type ChildProjectOptions struct {
    // Recursive resolve the child projects of a project recursively.
    // Child projects that are not visible to the calling user are ignored and are not resolved further.
    Recursive int `url:"recursive,omitempty"`
}

ChildProjectOptions specifies the parameters to the Child Project API endpoints.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#list-child-projects

type Client Uses

type Client struct {

    // Gerrit service for authentication.
    Authentication *AuthenticationService

    // Services used for talking to different parts of the standard Gerrit API.
    Access   *AccessService
    Accounts *AccountsService
    Changes  *ChangesService
    Config   *ConfigService
    Groups   *GroupsService
    Plugins  *PluginsService
    Projects *ProjectsService

    // Additional services used for talking to non-standard Gerrit APIs.
    EventsLog *EventsLogService
    // contains filtered or unexported fields
}

A Client manages communication with the Gerrit API.

func NewClient Uses

func NewClient(gerritURL string, httpClient *http.Client) (*Client, error)

NewClient returns a new Gerrit API client. gerritURL specifies the HTTP endpoint of the Gerrit instance. For example, "http://localhost:8080/". If gerritURL does not have a trailing slash, one is added automatically. If a nil httpClient is provided, http.DefaultClient will be used.

The url may contain credentials, http://admin:secret@localhost:8081/ for example. These credentials may either be a user name and password or name and value as in the case of cookie based authentication. If the url contains credentials then this function will attempt to validate the credentials before returning the client. ErrAuthenticationFailed will be returned if the credentials cannot be validated. The process of validating the credentials is relatively simple and only requires that the provided user have permission to GET /a/accounts/self.

func (*Client) BaseURL Uses

func (c *Client) BaseURL() url.URL

BaseURL returns the client's Gerrit instance HTTP endpoint.

func (*Client) Call Uses

func (c *Client) Call(method, u string, body interface{}, v interface{}) (*Response, error)

Call is a combine function for Client.NewRequest and Client.Do.

Most API methods are quite the same. Get the URL, apply options, make a request, and get the response. Without adding special headers or something. To avoid a big amount of code duplication you can Client.Call.

method is the HTTP method you want to call. u is the URL you want to call. body is the HTTP body. v is the HTTP response.

For more information read https://github.com/google/go-github/issues/234

func (*Client) DeleteRequest Uses

func (c *Client) DeleteRequest(urlStr string, body interface{}) (*Response, error)

DeleteRequest sends an DELETE API Request to urlStr with optional body. It is a shorthand combination for Client.NewRequest with Client.Do.

Relative URLs should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.

func (*Client) Do Uses

func (c *Client) Do(req *http.Request, v interface{}) (*Response, error)

Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it.

func (*Client) NewRawPutRequest Uses

func (c *Client) NewRawPutRequest(urlStr string, body string) (*http.Request, error)

NewRawPutRequest creates a raw PUT request and makes no attempt to encode or marshal the body. Just passes it straight through.

func (*Client) NewRequest Uses

func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

NewRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the baseURL of the Client. Relative URLs should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.

type CommentInfo Uses

type CommentInfo struct {
    PatchSet  int           `json:"patch_set,omitempty"`
    ID        string        `json:"id"`
    Path      string        `json:"path,omitempty"`
    Side      string        `json:"side,omitempty"`
    Line      int           `json:"line,omitempty"`
    Range     *CommentRange `json:"range,omitempty"`
    InReplyTo string        `json:"in_reply_to,omitempty"`
    Message   string        `json:"message,omitempty"`
    Updated   *Timestamp    `json:"updated"`
    Author    AccountInfo   `json:"author,omitempty"`
}

CommentInfo entity contains information about an inline comment.

type CommentInput Uses

type CommentInput struct {
    ID        string        `json:"id,omitempty"`
    Path      string        `json:"path,omitempty"`
    Side      string        `json:"side,omitempty"`
    Line      int           `json:"line,omitempty"`
    Range     *CommentRange `json:"range,omitempty"`
    InReplyTo string        `json:"in_reply_to,omitempty"`
    Updated   *Timestamp    `json:"updated,omitempty"`
    Message   string        `json:"message,omitempty"`
}

CommentInput entity contains information for creating an inline comment.

type CommentRange Uses

type CommentRange struct {
    StartLine      int `json:"start_line"`
    StartCharacter int `json:"start_character"`
    EndLine        int `json:"end_line"`
    EndCharacter   int `json:"end_character"`
}

CommentRange entity describes the range of an inline comment.

type CommitInfo Uses

type CommitInfo struct {
    Commit    string        `json:"commit,omitempty"`
    Parents   []CommitInfo  `json:"parents"`
    Author    GitPersonInfo `json:"author"`
    Committer GitPersonInfo `json:"committer"`
    Subject   string        `json:"subject"`
    Message   string        `json:"message"`
    WebLinks  []WebLinkInfo `json:"web_links,omitempty"`
}

CommitInfo entity contains information about a commit.

type CommitOptions Uses

type CommitOptions struct {
    // Adding query parameter links (for example /changes/.../commit?links) returns a CommitInfo with the additional field web_links.
    Weblinks bool `url:"links,omitempty"`
}

CommitOptions specifies the parameters for GetCommit call.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-commit

type ConfigCapabilityInfo Uses

type ConfigCapabilityInfo struct {
    ID   string `json:"id"`
    Name string `json:"name"`
}

ConfigCapabilityInfo entity contains information about a capability.type

type ConfigInfo Uses

type ConfigInfo struct {
    Description                      string                         `json:"description,omitempty"`
    UseContributorAgreements         InheritedBooleanInfo           `json:"use_contributor_agreements,omitempty"`
    UseContentMerge                  InheritedBooleanInfo           `json:"use_content_merge,omitempty"`
    UseSignedOffBy                   InheritedBooleanInfo           `json:"use_signed_off_by,omitempty"`
    CreateNewChangeForAllNotInTarget InheritedBooleanInfo           `json:"create_new_change_for_all_not_in_target,omitempty"`
    RequireChangeID                  InheritedBooleanInfo           `json:"require_change_id,omitempty"`
    EnableSignedPush                 InheritedBooleanInfo           `json:"enable_signed_push,omitempty"`
    MaxObjectSizeLimit               MaxObjectSizeLimitInfo         `json:"max_object_size_limit"`
    SubmitType                       string                         `json:"submit_type"`
    State                            string                         `json:"state,omitempty"`
    Commentlinks                     map[string]string              `json:"commentlinks"`
    Theme                            ThemeInfo                      `json:"theme,omitempty"`
    PluginConfig                     map[string]ConfigParameterInfo `json:"plugin_config,omitempty"`
    Actions                          map[string]ActionInfo          `json:"actions,omitempty"`
}

ConfigInfo entity contains information about the effective project configuration.

type ConfigInput Uses

type ConfigInput struct {
    Description                      string                       `json:"description,omitempty"`
    UseContributorAgreements         string                       `json:"use_contributor_agreements,omitempty"`
    UseContentMerge                  string                       `json:"use_content_merge,omitempty"`
    UseSignedOffBy                   string                       `json:"use_signed_off_by,omitempty"`
    CreateNewChangeForAllNotInTarget string                       `json:"create_new_change_for_all_not_in_target,omitempty"`
    RequireChangeID                  string                       `json:"require_change_id,omitempty"`
    MaxObjectSizeLimit               MaxObjectSizeLimitInfo       `json:"max_object_size_limit,omitempty"`
    SubmitType                       string                       `json:"submit_type,omitempty"`
    State                            string                       `json:"state,omitempty"`
    PluginConfigValues               map[string]map[string]string `json:"plugin_config_values,omitempty"`
}

ConfigInput entity describes a new project configuration.

type ConfigParameterInfo Uses

type ConfigParameterInfo struct {
    DisplayName string   `json:"display_name,omitempty"`
    Description string   `json:"description,omitempty"`
    Warning     string   `json:"warning,omitempty"`
    Type        string   `json:"type"`
    Value       string   `json:"value,omitempty"`
    Values      []string `json:"values,omitempty"`
}

ConfigParameterInfo entity describes a project configuration parameter.

type ConfigService Uses

type ConfigService struct {
    // contains filtered or unexported fields
}

ConfigService contains Config related REST endpoints

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html

func (*ConfigService) CacheOperations Uses

func (s *ConfigService) CacheOperations(input *CacheOperationInput) (*Response, error)

CacheOperations executes a cache operation that is specified in the request body in a CacheOperationInput entity.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#cache-operations

func (*ConfigService) ConfirmEmail Uses

func (s *ConfigService) ConfirmEmail(input *EmailConfirmationInput) (*Response, error)

ConfirmEmail confirms that the user owns an email address. The email token must be provided in the request body inside an EmailConfirmationInput entity.

The response is “204 No Content”. If the token is invalid or if it’s the token of another user the request fails and the response is “422 Unprocessable Entity”.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#confirm-email

func (*ConfigService) DeleteTask Uses

func (s *ConfigService) DeleteTask(taskID string) (*Response, error)

DeleteTask kills a task from the background work queue that the Gerrit daemon is currently performing, or will perform in the near future. The caller must be a member of a group that is granted one of the following capabilities:

* Kill Task * Maintain Server * Administrate Server

End-users may see a task only if they can also see the project the task is associated with. Tasks operating on other projects, or that do not have a specific project, are hidden. Members of a group granted one of the following capabilities may view all tasks:

* View Queue * Maintain Server * Administrate Server

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#delete-task

func (*ConfigService) FlushCache Uses

func (s *ConfigService) FlushCache(cacheName string, input *CacheOperationInput) (*Response, error)

FlushCache flushes a cache. The caller must be a member of a group that is granted one of the following capabilities:

* Flush Caches (any cache except "web_sessions") * Maintain Server (any cache including "web_sessions") * Administrate Server (any cache including "web_sessions")

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#flush-cache

func (*ConfigService) GetCache Uses

func (s *ConfigService) GetCache(cacheName string) (*CacheInfo, *Response, error)

GetCache retrieves information about a cache. The caller must be a member of a group that is granted one of the following capabilities: * View Caches * Maintain Server * Administrate Server

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#get-cache

func (*ConfigService) GetServerInfo Uses

func (s *ConfigService) GetServerInfo() (*ServerInfo, *Response, error)

GetServerInfo returns the information about the Gerrit server configuration.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#get-info

func (*ConfigService) GetSummary Uses

func (s *ConfigService) GetSummary(opt *SummaryOptions) (*SummaryInfo, *Response, error)

GetSummary retrieves a summary of the current server state. The caller must be a member of a group that is granted the Administrate Server capability.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#get-summary

func (*ConfigService) GetTask Uses

func (s *ConfigService) GetTask(taskID string) (*TaskInfo, *Response, error)

GetTask retrieves a task from the background work queue that the Gerrit daemon is currently performing, or will perform in the near future. End-users may see a task only if they can also see the project the task is associated with. Tasks operating on other projects, or that do not have a specific project, are hidden.

The caller must be a member of a group that is granted one of the following capabilities: * View Queue * Maintain Server * Administrate Server

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#get-task

func (*ConfigService) GetTopMenus Uses

func (s *ConfigService) GetTopMenus() (*[]TopMenuEntryInfo, *Response, error)

GetTopMenus returns the list of additional top menu entries.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#get-top-menus

func (*ConfigService) GetVersion Uses

func (s *ConfigService) GetVersion() (string, *Response, error)

GetVersion returns the version of the Gerrit server.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#get-version

Code:

instance := "https://gerrit-review.googlesource.com/"
client, err := gerrit.NewClient(instance, nil)
if err != nil {
    panic(err)
}

v, _, err := client.Config.GetVersion()
if err != nil {
    panic(err)
}
// We can`t output the direct version here, because
// the test would fail if gerrit-review.googlesource.com
// will upgrade their instance.
// To access the version just print variable v
if len(v) > 0 {
    fmt.Println("Got version from Gerrit")
}

Output:

Got version from Gerrit

func (*ConfigService) ListCaches Uses

func (s *ConfigService) ListCaches(opt *ListCachesOptions) (*map[string]CacheInfo, *Response, error)

ListCaches lists the caches of the server. Caches defined by plugins are included. The caller must be a member of a group that is granted one of the following capabilities: * View Caches * Maintain Server * Administrate Server The entries in the map are sorted by cache name.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#list-caches

func (*ConfigService) ListCapabilities Uses

func (s *ConfigService) ListCapabilities() (*map[string]ConfigCapabilityInfo, *Response, error)

ListCapabilities lists the capabilities that are available in the system. There are two kinds of capabilities: core and plugin-owned capabilities. The entries in the map are sorted by capability ID.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#list-capabilities

func (*ConfigService) ListTasks Uses

func (s *ConfigService) ListTasks() (*[]TaskInfo, *Response, error)

ListTasks lists the tasks from the background work queues that the Gerrit daemon is currently performing, or will perform in the near future. Gerrit contains an internal scheduler, similar to cron, that it uses to queue and dispatch both short and long term tasks. Tasks that are completed or canceled exit the queue very quickly once they enter this state, but it can be possible to observe tasks in these states. End-users may see a task only if they can also see the project the task is associated with. Tasks operating on other projects, or that do not have a specific project, are hidden.

The caller must be a member of a group that is granted one of the following capabilities: * View Queue * Maintain Server * Administrate Server

The entries in the list are sorted by task state, remaining delay and command.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#list-tasks

type DashboardInfo Uses

type DashboardInfo struct {
    ID              string                 `json:"id"`
    Project         string                 `json:"project"`
    DefiningProject string                 `json:"defining_project"`
    Ref             string                 `json:"ref"`
    Path            string                 `json:"path"`
    Description     string                 `json:"description,omitempty"`
    Foreach         string                 `json:"foreach,omitempty"`
    URL             string                 `json:"url"`
    Default         bool                   `json:"default"`
    Title           string                 `json:"title,omitempty"`
    Sections        []DashboardSectionInfo `json:"sections"`
}

DashboardInfo entity contains information about a project dashboard.

type DashboardInput Uses

type DashboardInput struct {
    ID            string `json:"id,omitempty"`
    CommitMessage string `json:"commit_message,omitempty"`
}

DashboardInput entity contains information to create/update a project dashboard.

type DashboardSectionInfo Uses

type DashboardSectionInfo struct {
    Name  string `json:"name"`
    Query string `json:"query"`
}

DashboardSectionInfo entity contains information about a section in a dashboard.

type DeleteBranchesInput Uses

type DeleteBranchesInput struct {
    Branches []string `json:"DeleteBranchesInput"`
}

DeleteBranchesInput entity contains information about branches that should be deleted.

type DeleteVoteInput Uses

type DeleteVoteInput struct {
    Label         string                `json:"label,omitempty"`
    Notify        string                `json:"notify,omitempty"`
    NotifyDetails map[string]NotifyInfo `json:"notify_details"`
}

DeleteVoteInput entity contains options for the deletion of a vote.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-vote-input

type DiffContent Uses

type DiffContent struct {
    A      []string          `json:"a,omitempty"`
    B      []string          `json:"b,omitempty"`
    AB     []string          `json:"ab,omitempty"`
    EditA  DiffIntralineInfo `json:"edit_a,omitempty"`
    EditB  DiffIntralineInfo `json:"edit_b,omitempty"`
    Skip   int               `json:"skip,omitempty"`
    Common bool              `json:"common,omitempty"`
}

DiffContent entity contains information about the content differences in a file.

type DiffFileMetaInfo Uses

type DiffFileMetaInfo struct {
    Name        string        `json:"name"`
    ContentType string        `json:"content_type"`
    Lines       int           `json:"lines"`
    WebLinks    []WebLinkInfo `json:"web_links,omitempty"`
}

DiffFileMetaInfo entity contains meta information about a file diff

type DiffInfo Uses

type DiffInfo struct {
    MetaA           DiffFileMetaInfo  `json:"meta_a,omitempty"`
    MetaB           DiffFileMetaInfo  `json:"meta_b,omitempty"`
    ChangeType      string            `json:"change_type"`
    IntralineStatus string            `json:"intraline_status,omitempty"`
    DiffHeader      []string          `json:"diff_header"`
    Content         []DiffContent     `json:"content"`
    WebLinks        []DiffWebLinkInfo `json:"web_links,omitempty"`
    Binary          bool              `json:"binary,omitempty"`
}

DiffInfo entity contains information about the diff of a file in a revision.

type DiffIntralineInfo Uses

type DiffIntralineInfo [][2]int

DiffIntralineInfo entity contains information about intraline edits in a file.

The information consists of a list of <skip length, mark length> pairs, where the skip length is the number of characters between the end of the previous edit and the start of this edit, and the mark length is the number of edited characters following the skip. The start of the edits is from the beginning of the related diff content lines.

Note that the implied newline character at the end of each line is included in the length calculation, and thus it is possible for the edits to span newlines.

type DiffOptions Uses

type DiffOptions struct {
    // If the intraline parameter is specified, intraline differences are included in the diff.
    Intraline bool `url:"intraline,omitempty"`

    // The base parameter can be specified to control the base patch set from which the diff
    // should be generated.
    Base string `url:"base,omitempty"`

    // The integer-valued request parameter parent can be specified to control the parent commit number
    // against which the diff should be generated. This is useful for supporting review of merge commits.
    // The value is the 1-based index of the parent’s position in the commit object.
    Parent int `url:"parent,omitempty"`

    // If the weblinks-only parameter is specified, only the diff web links are returned.
    WeblinksOnly bool `url:"weblinks-only,omitempty"`

    // The ignore-whitespace parameter can be specified to control how whitespace differences are reported in the result. Valid values are NONE, TRAILING, CHANGED or ALL.
    IgnoreWhitespace string `url:"ignore-whitespace,omitempty"`

    // The context parameter can be specified to control the number of lines of surrounding context in the diff.
    // Valid values are ALL or number of lines.
    Context string `url:"context,omitempty"`
}

DiffOptions specifies the parameters for GetDiff call.

type DiffPreferencesInfo Uses

type DiffPreferencesInfo struct {
    Context                 int    `json:"context"`
    Theme                   string `json:"theme"`
    ExpandAllComments       bool   `json:"expand_all_comments,omitempty"`
    IgnoreWhitespace        string `json:"ignore_whitespace"`
    IntralineDifference     bool   `json:"intraline_difference,omitempty"`
    LineLength              int    `json:"line_length"`
    ManualReview            bool   `json:"manual_review,omitempty"`
    RetainHeader            bool   `json:"retain_header,omitempty"`
    ShowLineEndings         bool   `json:"show_line_endings,omitempty"`
    ShowTabs                bool   `json:"show_tabs,omitempty"`
    ShowWhitespaceErrors    bool   `json:"show_whitespace_errors,omitempty"`
    SkipDeleted             bool   `json:"skip_deleted,omitempty"`
    SkipUncommented         bool   `json:"skip_uncommented,omitempty"`
    SyntaxHighlighting      bool   `json:"syntax_highlighting,omitempty"`
    HideTopMenu             bool   `json:"hide_top_menu,omitempty"`
    AutoHideDiffTableHeader bool   `json:"auto_hide_diff_table_header,omitempty"`
    HideLineNumbers         bool   `json:"hide_line_numbers,omitempty"`
    TabSize                 int    `json:"tab_size"`
    HideEmptyPane           bool   `json:"hide_empty_pane,omitempty"`
}

DiffPreferencesInfo entity contains information about the diff preferences of a user.

type DiffPreferencesInput Uses

type DiffPreferencesInput struct {
    Context                 int    `json:"context,omitempty"`
    ExpandAllComments       bool   `json:"expand_all_comments,omitempty"`
    IgnoreWhitespace        string `json:"ignore_whitespace,omitempty"`
    IntralineDifference     bool   `json:"intraline_difference,omitempty"`
    LineLength              int    `json:"line_length,omitempty"`
    ManualReview            bool   `json:"manual_review,omitempty"`
    RetainHeader            bool   `json:"retain_header,omitempty"`
    ShowLineEndings         bool   `json:"show_line_endings,omitempty"`
    ShowTabs                bool   `json:"show_tabs,omitempty"`
    ShowWhitespaceErrors    bool   `json:"show_whitespace_errors,omitempty"`
    SkipDeleted             bool   `json:"skip_deleted,omitempty"`
    SkipUncommented         bool   `json:"skip_uncommented,omitempty"`
    SyntaxHighlighting      bool   `json:"syntax_highlighting,omitempty"`
    HideTopMenu             bool   `json:"hide_top_menu,omitempty"`
    AutoHideDiffTableHeader bool   `json:"auto_hide_diff_table_header,omitempty"`
    HideLineNumbers         bool   `json:"hide_line_numbers,omitempty"`
    TabSize                 int    `json:"tab_size,omitempty"`
}

DiffPreferencesInput entity contains information for setting the diff preferences of a user. Fields which are not set will not be updated.

type DiffWebLinkInfo Uses

type DiffWebLinkInfo struct {
    Name                     string `json:"name"`
    URL                      string `json:"url"`
    ImageURL                 string `json:"image_url"`
    ShowOnSideBySideDiffView bool   `json:"show_on_side_by_side_diff_view"`
    ShowOnUnifiedDiffView    bool   `json:"show_on_unified_diff_view"`
}

DiffWebLinkInfo entity describes a link on a diff screen to an external site.

type DownloadInfo Uses

type DownloadInfo struct {
    Schemes  map[string]DownloadSchemeInfo `json:"schemes"`
    Archives []string                      `json:"archives"`
}

DownloadInfo entity contains information about supported download options.

type DownloadSchemeInfo Uses

type DownloadSchemeInfo struct {
    URL             string            `json:"url"`
    IsAuthRequired  bool              `json:"is_auth_required,omitempty"`
    IsAuthSupported bool              `json:"is_auth_supported,omitempty"`
    Commands        map[string]string `json:"commands"`
    CloneCommands   map[string]string `json:"clone_commands"`
}

DownloadSchemeInfo entity contains information about a supported download scheme and its commands.

type EditFileInfo Uses

type EditFileInfo struct {
    WebLinks []WebLinkInfo `json:"web_links,omitempty"`
}

EditFileInfo entity contains additional information of a file within a change edit.

type EditInfo Uses

type EditInfo struct {
    Commit       CommitInfo           `json:"commit"`
    BaseRevision string               `json:"baseRevision"`
    Fetch        map[string]FetchInfo `json:"fetch"`
    Files        map[string]FileInfo  `json:"files,omitempty"`
}

EditInfo entity contains information about a change edit.

type EmailConfirmationInput Uses

type EmailConfirmationInput struct {
    Token string `json:"token"`
}

EmailConfirmationInput entity contains information for confirming an email address.

type EmailInfo Uses

type EmailInfo struct {
    Email               string `json:"email"`
    Preferred           bool   `json:"preferred,omitempty"`
    PendingConfirmation bool   `json:"pending_confirmation,omitempty"`
}

EmailInfo entity contains information about an email address of a user.

type EmailInput Uses

type EmailInput struct {
    Email          string `json:"email"`
    Preferred      bool   `json:"preferred,omitempty"`
    NoConfirmation bool   `json:"no_confirmation,omitempty"`
}

EmailInput entity contains information for registering a new email address.

type EntriesInfo Uses

type EntriesInfo struct {
    Mem   int    `json:"mem,omitempty"`
    Disk  int    `json:"disk,omitempty"`
    Space string `json:"space,omitempty"`
}

EntriesInfo entity contains information about the entries in a cache.

type EventInfo Uses

type EventInfo struct {
    Type           string        `json:"type"`
    Change         ChangeInfo    `json:"change,omitempty"`
    ChangeKey      ChangeInfo    `json:"changeKey,omitempty"`
    PatchSet       PatchSet      `json:"patchSet,omitempty"`
    EventCreatedOn int           `json:"eventCreatedOn,omitempty"`
    Reason         string        `json:"reason,omitempty"`
    Abandoner      AccountInfo   `json:"abandoner,omitempty"`
    Restorer       AccountInfo   `json:"restorer,omitempty"`
    Submitter      AccountInfo   `json:"submitter,omitempty"`
    Author         AccountInfo   `json:"author,omitempty"`
    Uploader       AccountInfo   `json:"uploader,omitempty"`
    Approvals      []AccountInfo `json:"approvals,omitempty"`
    Comment        string        `json:"comment,omitempty"`
    Editor         AccountInfo   `json:"editor,omitempty"`
    Added          []string      `json:"added,omitempty"`
    Removed        []string      `json:"removed,omitempty"`
    Hashtags       []string      `json:"hashtags,omitempty"`
    RefUpdate      RefUpdate     `json:"refUpdate,omitempty"`
    Project        ProjectInfo   `json:"project,omitempty"`
    Reviewer       AccountInfo   `json:"reviewer,omitempty"`
    OldTopic       string        `json:"oldTopic,omitempty"`
    Changer        AccountInfo   `json:"changer,omitempty"`
}

EventInfo contains information about an event emitted by Gerrit. This structure can be used either when parsing streamed events or when reading the output of the events-log plugin.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/cmd-stream-events.html#events

type EventsLogOptions Uses

type EventsLogOptions struct {
    From time.Time
    To   time.Time

    // IgnoreUnmarshalErrors will cause GetEvents to ignore any errors
    // that come up when calling json.Unmarshal. This can be useful in
    // cases where the events-log plugin was not kept up to date with
    // the Gerrit version for some reason. In these cases the events-log
    // plugin will return data structs that don't match the EventInfo
    // struct which in turn causes issues for json.Unmarshal.
    IgnoreUnmarshalErrors bool
}

EventsLogOptions contains options for querying events from the events-logs plugin.

type EventsLogService Uses

type EventsLogService struct {
    // contains filtered or unexported fields
}

EventsLogService contains functions for querying the API provided by the optional events-log plugin.

func (*EventsLogService) GetEvents Uses

func (events *EventsLogService) GetEvents(options *EventsLogOptions) ([]EventInfo, *Response, [][]byte, error)

GetEvents returns a list of events for the given input options. Use of this function requires an authenticated user and for the events-log plugin to be installed. This function returns the unmarshalled EventInfo structs, response, failed lines and errors. Marshaling errors will cause this function to return before processing is complete unless you set EventsLogOptions.IgnoreUnmarshalErrors to true. This can be useful in cases where the events-log plugin got out of sync with the Gerrit version which in turn produced events which can't be transformed unmarshalled into EventInfo.

Gerrit API docs: https://<yourserver>/plugins/events-log/Documentation/rest-api-events.html

type FetchInfo Uses

type FetchInfo struct {
    URL      string            `json:"url"`
    Ref      string            `json:"ref"`
    Commands map[string]string `json:"commands,omitempty"`
}

FetchInfo entity contains information about how to fetch a patch set via a certain protocol.

type FileInfo Uses

type FileInfo struct {
    Status        string `json:"status,omitempty"`
    Binary        bool   `json:"binary,omitempty"`
    OldPath       string `json:"old_path,omitempty"`
    LinesInserted int    `json:"lines_inserted,omitempty"`
    LinesDeleted  int    `json:"lines_deleted,omitempty"`
    SizeDelta     int    `json:"size_delta"`
    Size          int    `json:"size"`
}

FileInfo entity contains information about a file in a patch set.

type FilesOptions Uses

type FilesOptions struct {
    // The request parameter q changes the response to return a list of all files (modified or unmodified)
    // that contain that substring in the path name. This is useful to implement suggestion services
    // finding a file by partial name.
    Q   string `url:"q,omitempty"`

    // The base parameter can be specified to control the base patch set from which the list of files
    // should be generated.
    //
    // Note: This option is undocumented.
    Base string `url:"base,omitempty"`

    // The integer-valued request parameter parent changes the response to return a list of the files
    // which are different in this commit compared to the given parent commit. This is useful for
    // supporting review of merge commits. The value is the 1-based index of the parent’s position
    // in the commit object.
    Parent int `url:"parent,omitempty"`
}

FilesOptions specifies the parameters for ListFiles and ListFilesReviewed calls.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-files

type FixInput Uses

type FixInput struct {
    DeletePatchSetIfCommitMissing bool   `json:"delete_patch_set_if_commit_missing"`
    ExpectMergedAs                string `json:"expect_merged_as"`
}

FixInput entity contains options for fixing commits using the fix change endpoint.

type FixReplacementInfo Uses

type FixReplacementInfo struct {
    // The path of the file which should be modified. Any file in the repository may be modified.
    Path string `json:"path"`

    // A CommentRange indicating which content of the file should be replaced.
    // Lines in the file are assumed to be separated by the line feed character,
    // the carriage return character, the carriage return followed by the line
    // feed character, or one of the other Unicode linebreak sequences supported
    // by Java.
    Range CommentRange `json:"range"`

    // The content which should be used instead of the current one.
    Replacement string `json:"replacement,omitempty"`
}

FixReplacementInfo entity describes how the content of a file should be replaced by another content. https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#fix-replacement-info

type FixSuggestionInfo Uses

type FixSuggestionInfo struct {
    // The UUID of the suggested fix. It will be generated automatically and
    // hence will be ignored if it’s set for input objects.
    FixID string `json:"fix_id"`
    // A description of the suggested fix.
    Description string `json:"description"`
    // A list of FixReplacementInfo entities indicating how the content of one or
    // several files should be modified. Within a file, they should refer to
    // non-overlapping regions.
    Replacements FixReplacementInfo `json:"replacements"`
}

FixSuggestionInfo entity represents a suggested fix. https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#fix-suggestion-info

type GCInput Uses

type GCInput struct {
    ShowProgress bool `json:"show_progress"`
    Aggressive   bool `json:"aggressive"`
}

GCInput entity contains information to run the Git garbage collection.

type GitPersonInfo Uses

type GitPersonInfo struct {
    Name  string    `json:"name"`
    Email string    `json:"email"`
    Date  Timestamp `json:"date"`
    TZ    int       `json:"tz"`
}

GitPersonInfo entity contains information about the author/committer of a commit.

type GitwebInfo Uses

type GitwebInfo struct {
    URL  string         `json:"url"`
    Type GitwebTypeInfo `json:"type"`
}

GitwebInfo entity contains information about the gitweb configuration.

type GitwebTypeInfo Uses

type GitwebTypeInfo struct {
    Name          string `json:"name"`
    Revision      string `json:"revision,omitempty"`
    Project       string `json:"project,omitempty"`
    Branch        string `json:"branch,omitempty"`
    RootTree      string `json:"root_tree,omitempty"`
    File          string `json:"file,omitempty"`
    FileHistory   string `json:"file_history,omitempty"`
    PathSeparator string `json:"path_separator"`
    LinkDrafts    bool   `json:"link_drafts,omitempty"`
    URLEncode     bool   `json:"url_encode,omitempty"`
}

GitwebTypeInfo entity contains information about the gitweb configuration.

type GpgKeyInfo Uses

type GpgKeyInfo struct {
    ID          string   `json:"id,omitempty"`
    Fingerprint string   `json:"fingerprint,omitempty"`
    UserIDs     []string `json:"user_ids,omitempty"`
    Key         string   `json:"key,omitempty"`
}

GpgKeyInfo entity contains information about a GPG public key.

type GpgKeysInput Uses

type GpgKeysInput struct {
    Add    []string `json:"add"`
    Delete []string `json:"delete"`
}

GpgKeysInput entity contains information for adding/deleting GPG keys.

type GroupAuditEventInfo Uses

type GroupAuditEventInfo struct {
    // TODO Member AccountInfo OR GroupInfo `json:"member"`
    Type string      `json:"type"`
    User AccountInfo `json:"user"`
    Date Timestamp   `json:"date"`
}

GroupAuditEventInfo entity contains information about an audit event of a group.

type GroupBaseInfo Uses

type GroupBaseInfo struct {
    ID   int    `json:"id"`
    Name string `json:"name"`
}

GroupBaseInfo entity contains base information about the group.

type GroupInfo Uses

type GroupInfo struct {
    ID          string           `json:"id"`
    Name        string           `json:"name,omitempty"`
    URL         string           `json:"url,omitempty"`
    Options     GroupOptionsInfo `json:"options"`
    Description string           `json:"description,omitempty"`
    GroupID     int              `json:"group_id,omitempty"`
    Owner       string           `json:"owner,omitempty"`
    OwnerID     string           `json:"owner_id,omitempty"`
    CreatedOn   *Timestamp       `json:"created_on,omitempty"`
    Members     []AccountInfo    `json:"members,omitempty"`
    Includes    []GroupInfo      `json:"includes,omitempty"`
}

GroupInfo entity contains information about a group. This can be a Gerrit internal group, or an external group that is known to Gerrit.

type GroupInput Uses

type GroupInput struct {
    Name         string `json:"name,omitempty"`
    Description  string `json:"description,omitempty"`
    VisibleToAll bool   `json:"visible_to_all,omitempty"`
    OwnerID      string `json:"owner_id,omitempty"`
}

GroupInput entity contains information for the creation of a new internal group.

type GroupOptionsInfo Uses

type GroupOptionsInfo struct {
    VisibleToAll bool `json:"visible_to_all,omitempty"`
}

GroupOptionsInfo entity contains options of the group.

type GroupOptionsInput Uses

type GroupOptionsInput struct {
    VisibleToAll bool `json:"visible_to_all,omitempty"`
}

GroupOptionsInput entity contains new options for a group.

type GroupsInput Uses

type GroupsInput struct {
    OneGroup string   `json:"_one_group,omitempty"`
    Groups   []string `json:"groups,omitempty"`
}

GroupsInput entity contains information about groups that should be included into a group or that should be deleted from a group.

type GroupsService Uses

type GroupsService struct {
    // contains filtered or unexported fields
}

GroupsService contains Group related REST endpoints

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html

func (*GroupsService) AddGroupMember Uses

func (s *GroupsService) AddGroupMember(groupID, accountID string) (*AccountInfo, *Response, error)

AddGroupMember adds a user as member to a Gerrit internal group.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#add-group-member

func (*GroupsService) AddGroupMembers Uses

func (s *GroupsService) AddGroupMembers(groupID string, input *MembersInput) (*[]AccountInfo, *Response, error)

AddGroupMembers adds one or several users to a Gerrit internal group. The users to be added to the group must be provided in the request body as a MembersInput entity.

As response a list of detailed AccountInfo entities is returned that describes the group members that were specified in the MembersInput. An AccountInfo entity is returned for each user specified in the input, independently of whether the user was newly added to the group or whether the user was already a member of the group.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#_add_group_members

func (*GroupsService) CreateGroup Uses

func (s *GroupsService) CreateGroup(groupID string, input *GroupInput) (*GroupInfo, *Response, error)

CreateGroup creates a new Gerrit internal group. In the request body additional data for the group can be provided as GroupInput.

As response the GroupInfo entity is returned that describes the created group. If the group creation fails because the name is already in use the response is “409 Conflict”.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#create-group

func (*GroupsService) DeleteGroupDescription Uses

func (s *GroupsService) DeleteGroupDescription(groupID string) (*Response, error)

DeleteGroupDescription deletes the description of a Gerrit internal group.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#delete-group-description

func (*GroupsService) DeleteGroupMember Uses

func (s *GroupsService) DeleteGroupMember(groupID, accountID string) (*Response, error)

DeleteGroupMember deletes a user from a Gerrit internal group.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#delete-group-member

func (*GroupsService) DeleteGroupMembers Uses

func (s *GroupsService) DeleteGroupMembers(groupID string, input *MembersInput) (*Response, error)

DeleteGroupMembers delete one or several users from a Gerrit internal group. The users to be deleted from the group must be provided in the request body as a MembersInput entity.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#delete-group-members

func (*GroupsService) DeleteIncludedGroup Uses

func (s *GroupsService) DeleteIncludedGroup(groupID, includeGroupID string) (*Response, error)

DeleteIncludedGroup deletes an included group from a Gerrit internal group.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#include-group

func (*GroupsService) DeleteIncludedGroups Uses

func (s *GroupsService) DeleteIncludedGroups(groupID string, input *GroupsInput) (*Response, error)

DeleteIncludedGroups delete one or several included groups from a Gerrit internal group. The groups to be deleted from the group must be provided in the request body as a GroupsInput entity.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#delete-included-groups

func (*GroupsService) GetAuditLog Uses

func (s *GroupsService) GetAuditLog(groupID string) (*[]GroupAuditEventInfo, *Response, error)

GetAuditLog gets the audit log of a Gerrit internal group. The returned audit events are sorted by date in reverse order so that the newest audit event comes first.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#get-audit-log

func (*GroupsService) GetGroup Uses

func (s *GroupsService) GetGroup(groupID string) (*GroupInfo, *Response, error)

GetGroup retrieves a group.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#get-group

func (*GroupsService) GetGroupDescription Uses

func (s *GroupsService) GetGroupDescription(groupID string) (string, *Response, error)

GetGroupDescription retrieves the description of a group.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#get-group-description

func (*GroupsService) GetGroupDetail Uses

func (s *GroupsService) GetGroupDetail(groupID string) (*GroupInfo, *Response, error)

GetGroupDetail retrieves a group with the direct members and the directly included groups.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#get-group-detail

func (*GroupsService) GetGroupMember Uses

func (s *GroupsService) GetGroupMember(groupID, accountID string) (*AccountInfo, *Response, error)

GetGroupMember retrieves a group member.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#get-group-member

func (*GroupsService) GetGroupName Uses

func (s *GroupsService) GetGroupName(groupID string) (string, *Response, error)

GetGroupName retrieves the name of a group.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#get-group-name

func (*GroupsService) GetGroupOptions Uses

func (s *GroupsService) GetGroupOptions(groupID string) (*GroupOptionsInfo, *Response, error)

GetGroupOptions retrieves the options of a group.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#get-group-options

func (*GroupsService) GetGroupOwner Uses

func (s *GroupsService) GetGroupOwner(groupID string) (*GroupInfo, *Response, error)

GetGroupOwner retrieves the owner group of a Gerrit internal group.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#get-group-owner

func (*GroupsService) GetIncludedGroup Uses

func (s *GroupsService) GetIncludedGroup(groupID, includeGroupID string) (*GroupInfo, *Response, error)

GetIncludedGroup retrieves an included group.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#get-included-group

func (*GroupsService) IncludeGroup Uses

func (s *GroupsService) IncludeGroup(groupID, includeGroupID string) (*GroupInfo, *Response, error)

IncludeGroup includes an internal or external group into a Gerrit internal group. External groups must be specified using the UUID.

As response a GroupInfo entity is returned that describes the included group. The request also succeeds if the group is already included in this group, but then the HTTP response code is 200 OK.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#include-group

func (*GroupsService) IncludeGroups Uses

func (s *GroupsService) IncludeGroups(groupID string, input *GroupsInput) (*[]GroupInfo, *Response, error)

IncludeGroups includes one or several groups into a Gerrit internal group. The groups to be included into the group must be provided in the request body as a GroupsInput entity.

As response a list of GroupInfo entities is returned that describes the groups that were specified in the GroupsInput. A GroupInfo entity is returned for each group specified in the input, independently of whether the group was newly included into the group or whether the group was already included in the group.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#include-groups

func (*GroupsService) ListGroupMembers Uses

func (s *GroupsService) ListGroupMembers(groupID string, opt *ListGroupMembersOptions) (*[]AccountInfo, *Response, error)

ListGroupMembers lists the direct members of a Gerrit internal group. The entries in the list are sorted by full name, preferred email and id.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#group-members

func (*GroupsService) ListGroups Uses

func (s *GroupsService) ListGroups(opt *ListGroupsOptions) (*map[string]GroupInfo, *Response, error)

ListGroups lists the groups accessible by the caller. This is the same as using the ls-groups command over SSH, and accepts the same options as query parameters. The entries in the map are sorted by group name.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#list-groups

func (*GroupsService) ListIncludedGroups Uses

func (s *GroupsService) ListIncludedGroups(groupID string) (*[]GroupInfo, *Response, error)

ListIncludedGroups lists the directly included groups of a group. The entries in the list are sorted by group name and UUID.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#included-groups

func (*GroupsService) RenameGroup Uses

func (s *GroupsService) RenameGroup(groupID, name string) (*string, *Response, error)

RenameGroup renames a Gerrit internal group. The new group name must be provided in the request body.

As response the new group name is returned. If renaming the group fails because the new name is already in use the response is “409 Conflict”.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#rename-group

func (*GroupsService) SetGroupDescription Uses

func (s *GroupsService) SetGroupDescription(groupID, description string) (*string, *Response, error)

SetGroupDescription sets the description of a Gerrit internal group. The new group description must be provided in the request body.

As response the new group description is returned. If the description was deleted the response is “204 No Content”.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#set-group-description

func (*GroupsService) SetGroupOptions Uses

func (s *GroupsService) SetGroupOptions(groupID string, input *GroupOptionsInput) (*GroupOptionsInfo, *Response, error)

SetGroupOptions sets the options of a Gerrit internal group. The new group options must be provided in the request body as a GroupOptionsInput entity.

As response the new group options are returned as a GroupOptionsInfo entity.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#set-group-options

func (*GroupsService) SetGroupOwner Uses

func (s *GroupsService) SetGroupOwner(groupID, owner string) (*GroupInfo, *Response, error)

SetGroupOwner sets the owner group of a Gerrit internal group. The new owner group must be provided in the request body. The new owner can be specified by name, by group UUID or by the legacy numeric group ID.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#set-group-owner

type HTTPPasswordInput Uses

type HTTPPasswordInput struct {
    Generate     bool   `json:"generate,omitempty"`
    HTTPPassword string `json:"http_password,omitempty"`
}

HTTPPasswordInput entity contains information for setting/generating an HTTP password.

type HeadInput Uses

type HeadInput struct {
    Ref string `json:"ref"`
}

HeadInput entity contains information for setting HEAD for a project.

type HitRatioInfo Uses

type HitRatioInfo struct {
    Mem  int `json:"mem"`
    Disk int `json:"disk,omitempty"`
}

HitRatioInfo entity contains information about the hit ratio of a cache.

type IncludedInInfo Uses

type IncludedInInfo struct {
    Branches []string          `json:"branches"`
    Tags     []string          `json:"tags"`
    External map[string]string `json:"external,omitempty"`
}

IncludedInInfo entity contains information about the branches a change was merged into and tags it was tagged with.

type Info Uses

type Info struct {
    AllProjectsName string `json:"all_projects_name"`
    AllUsersName    string `json:"all_users_name"`
    DocURL          string `json:"doc_url,omitempty"`
    ReportBugURL    string `json:"report_bug_url,omitempty"`
    ReportBugText   string `json:"report_bug_text,omitempty"`
}

Info entity contains information about Gerrit configuration from the gerrit section.

type InheritedBooleanInfo Uses

type InheritedBooleanInfo struct {
    Value           bool   `json:"value"`
    ConfiguredValue string `json:"configured_value"`
    InheritedValue  bool   `json:"inherited_value,omitempty"`
}

InheritedBooleanInfo entity represents a boolean value that can also be inherited.

type JvmSummaryInfo Uses

type JvmSummaryInfo struct {
    VMVendor                string `json:"vm_vendor"`
    VMName                  string `json:"vm_name"`
    VMVersion               string `json:"vm_version"`
    OSName                  string `json:"os_name"`
    OSVersion               string `json:"os_version"`
    OSArch                  string `json:"os_arch"`
    User                    string `json:"user"`
    Host                    string `json:"host,omitempty"`
    CurrentWorkingDirectory string `json:"current_working_directory"`
    Site                    string `json:"site"`
}

JvmSummaryInfo entity contains information about the JVM.

type LabelInfo Uses

type LabelInfo struct {
    Optional bool `json:"optional,omitempty"`

    // Fields set by LABELS
    Approved     AccountInfo `json:"approved,omitempty"`
    Rejected     AccountInfo `json:"rejected,omitempty"`
    Recommended  AccountInfo `json:"recommended,omitempty"`
    Disliked     AccountInfo `json:"disliked,omitempty"`
    Blocking     bool        `json:"blocking,omitempty"`
    Value        int         `json:"value,omitempty"`
    DefaultValue int         `json:"default_value,omitempty"`

    // Fields set by DETAILED_LABELS
    All    []ApprovalInfo    `json:"all,omitempty"`
    Values map[string]string `json:"values,omitempty"`
}

LabelInfo entity contains information about a label on a change, always corresponding to the current patch set.

type ListAccessRightsOptions Uses

type ListAccessRightsOptions struct {
    // The projects for which the access rights should be returned must be specified as project options.
    // The project can be specified multiple times.
    Project []string `url:"project,omitempty"`
}

ListAccessRightsOptions specifies the parameters to the AccessService.ListAccessRights.

type ListCachesOptions Uses

type ListCachesOptions struct {
    // Format specifies the different output formats.
    Format string `url:"format,omitempty"`
}

ListCachesOptions specifies the different output formats.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#list-caches

type ListGroupMembersOptions Uses

type ListGroupMembersOptions struct {
    // To resolve the included groups of a group recursively and to list all members the parameter recursive can be set.
    // Members from included external groups and from included groups which are not visible to the calling user are ignored.
    Recursive bool `url:"recursive,omitempty"`
}

ListGroupMembersOptions specifies the different options for the ListGroupMembers call.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#group-members

type ListGroupsOptions Uses

type ListGroupsOptions struct {
    // Group Options
    // Options fields can be obtained by adding o parameters, each option requires more lookups and slows down the query response time to the client so they are generally disabled by default.
    // Optional fields are:
    //	INCLUDES: include list of directly included groups.
    //	MEMBERS: include list of direct group members.
    Options []string `url:"o,omitempty"`

    // Check if a group is owned by the calling user
    // By setting the option owned and specifying a group to inspect with the option q, it is possible to find out, if this group is owned by the calling user.
    // If the group is owned by the calling user, the returned map contains this group. If the calling user doesn’t own this group an empty map is returned.
    Owned string `url:"owned,omitempty"`
    Group string `url:"q,omitempty"`

    // Group Limit
    // The /groups/ URL also accepts a limit integer in the n parameter. This limits the results to show n groups.
    Limit int `url:"n,omitempty"`
    // The /groups/ URL also accepts a start integer in the S parameter. The results will skip S groups from group list.
    Skip int `url:"S,omitempty"`
}

ListGroupsOptions specifies the different options for the ListGroups call.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#list-groups

type MaxObjectSizeLimitInfo Uses

type MaxObjectSizeLimitInfo struct {
    Value           string `json:"value,omitempty"`
    ConfiguredValue string `json:"configured_value,omitempty"`
    InheritedValue  string `json:"inherited_value,omitempty"`
}

MaxObjectSizeLimitInfo entity contains information about the max object size limit of a project.

type MemSummaryInfo Uses

type MemSummaryInfo struct {
    Total     string `json:"total"`
    Used      string `json:"used"`
    Free      string `json:"free"`
    Buffers   string `json:"buffers"`
    Max       string `json:"max"`
    OpenFiles int    `json:"open_files,omitempty"`
}

MemSummaryInfo entity contains information about the current memory usage.

type MembersInput Uses

type MembersInput struct {
    OneMember string   `json:"_one_member,omitempty"`
    Members   []string `json:"members,omitempty"`
}

MembersInput entity contains information about accounts that should be added as members to a group or that should be deleted from the group

type MergableOptions Uses

type MergableOptions struct {
    // If the other-branches parameter is specified, the mergeability will also be checked for all other branches.
    OtherBranches bool `url:"other-branches,omitempty"`
}

MergableOptions specifies the parameters for GetMergable call.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-mergeable

type MergeableInfo Uses

type MergeableInfo struct {
    SubmitType    string   `json:"submit_type"`
    Mergeable     bool     `json:"mergeable"`
    MergeableInto []string `json:"mergeable_into,omitempty"`
}

MergeableInfo entity contains information about the mergeability of a change.

type NotifyInfo Uses

type NotifyInfo struct {
    Accounts []AccountInfo `json:"accounts"`
}

NotifyInfo entity contains detailed information about who should be notified about an update

type Number Uses

type Number string

Number is a string representing a number. This type is only used in cases where the API being queried may return an inconsistent result.

func (*Number) Int Uses

func (n *Number) Int() (int, error)

Int returns the current number as an integer

func (*Number) String Uses

func (n *Number) String() string

String returns the string representing the current number.

func (*Number) UnmarshalJSON Uses

func (n *Number) UnmarshalJSON(data []byte) error

UnmarshalJSON will marshal the provided data into the current *Number struct.

type PatchOptions Uses

type PatchOptions struct {
    // Adding query parameter zip (for example /changes/.../patch?zip) returns the patch as a single file inside of a ZIP archive.
    // Clients can expand the ZIP to obtain the plain text patch, avoiding the need for a base64 decoding step.
    // This option implies download.
    Zip bool `url:"zip,omitempty"`

    // Query parameter download (e.g. /changes/.../patch?download) will suggest the browser save the patch as commitsha1.diff.base64, for later processing by command line tools.
    Download bool `url:"download,omitempty"`

    // If the path parameter is set, the returned content is a diff of the single file that the path refers to.
    Path string `url:"path,omitempty"`
}

PatchOptions specifies the parameters for GetPatch call.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-patch

type PatchSet Uses

type PatchSet struct {
    Number    Number      `json:"number"`
    Revision  string      `json:"revision"`
    Parents   []string    `json:"parents"`
    Ref       string      `json:"ref"`
    Uploader  AccountInfo `json:"uploader"`
    Author    AccountInfo `json:"author"`
    CreatedOn int         `json:"createdOn"`
    IsDraft   bool        `json:"isDraft"`
    Kind      string      `json:"kind"`
}

PatchSet contains detailed information about a specific patch set.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/json.html#patchSet

type PermissionInfo Uses

type PermissionInfo struct {
    Label     string                        `json:"label,omitempty"`
    Exclusive bool                          `json:"exclusive"`
    Rules     map[string]PermissionRuleInfo `json:"rules"`
}

PermissionInfo entity contains information about an assigned permission.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-access.html#permission-info

type PermissionRuleInfo Uses

type PermissionRuleInfo struct {
    // TODO Possible values for action: ALLOW, DENY or BLOCK, INTERACTIVE and BATCH
    Action string `json:"action"`
    Force  bool   `json:"force"`
    Min    int    `json:"min"`
    Max    int    `json:"max"`
}

PermissionRuleInfo entity contains information about a permission rule that is assigned to group.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-access.html#permission-rule-info

type PluginConfigInfo Uses

type PluginConfigInfo struct {
    // HasAvatars reports whether an avatar provider is registered.
    HasAvatars bool `json:"has_avatars,omitempty"`
}

PluginConfigInfo entity contains information about Gerrit extensions by plugins.

type PluginInfo Uses

type PluginInfo struct {
    ID       string `json:"id"`
    Version  string `json:"version"`
    IndexURL string `json:"index_url,omitempty"`
    Disabled bool   `json:"disabled,omitempty"`
}

PluginInfo entity describes a plugin.

type PluginInput Uses

type PluginInput struct {
    URL string `json:"url"`
}

PluginInput entity describes a plugin that should be installed.

type PluginOptions Uses

type PluginOptions struct {
    // All enabled that all plugins are returned (enabled and disabled).
    All bool `url:"all,omitempty"`
}

PluginOptions specifies the different options for the ListPlugins call.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-plugins.html#list-plugins

type PluginsService Uses

type PluginsService struct {
    // contains filtered or unexported fields
}

PluginsService contains Plugin related REST endpoints

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-plugins.html

func (*PluginsService) DisablePlugin Uses

func (s *PluginsService) DisablePlugin(pluginID string) (*PluginInfo, *Response, error)

DisablePlugin disables a plugin on the Gerrit server.

As response a PluginInfo entity is returned that describes the plugin.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-plugins.html#disable-plugin

func (*PluginsService) EnablePlugin Uses

func (s *PluginsService) EnablePlugin(pluginID string) (*PluginInfo, *Response, error)

EnablePlugin enables a plugin on the Gerrit server.

As response a PluginInfo entity is returned that describes the plugin.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-plugins.html#enable-plugin

func (*PluginsService) GetPluginStatus Uses

func (s *PluginsService) GetPluginStatus(pluginID string) (*PluginInfo, *Response, error)

GetPluginStatus retrieves the status of a plugin on the Gerrit server.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-plugins.html#get-plugin-status

func (*PluginsService) InstallPlugin Uses

func (s *PluginsService) InstallPlugin(pluginID string, input *PluginInput) (*PluginInfo, *Response, error)

InstallPlugin installs a new plugin on the Gerrit server. If a plugin with the specified name already exists it is overwritten.

Note: if the plugin provides its own name in the MANIFEST file, then the plugin name from the MANIFEST file has precedence over the {plugin-id} above.

The plugin jar can either be sent as binary data in the request body or a URL to the plugin jar must be provided in the request body inside a PluginInput entity.

As response a PluginInfo entity is returned that describes the plugin. If an existing plugin was overwritten the response is “200 OK”.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#set-dashboard

func (*PluginsService) ListPlugins Uses

func (s *PluginsService) ListPlugins(opt *PluginOptions) (*map[string]PluginInfo, *Response, error)

ListPlugins lists the plugins installed on the Gerrit server. Only the enabled plugins are returned unless the all option is specified.

To be allowed to see the installed plugins, a user must be a member of a group that is granted the 'View Plugins' capability or the 'Administrate Server' capability. The entries in the map are sorted by plugin ID.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-plugins.html#list-plugins

func (*PluginsService) ReloadPlugin Uses

func (s *PluginsService) ReloadPlugin(pluginID string) (*PluginInfo, *Response, error)

ReloadPlugin reloads a plugin on the Gerrit server.

As response a PluginInfo entity is returned that describes the plugin.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-plugins.html#disable-plugin

type PreferencesInfo Uses

type PreferencesInfo struct {
    ChangesPerPage            int               `json:"changes_per_page"`
    ShowSiteHeader            bool              `json:"show_site_header,omitempty"`
    UseFlashClipboard         bool              `json:"use_flash_clipboard,omitempty"`
    DownloadScheme            string            `json:"download_scheme"`
    DownloadCommand           string            `json:"download_command"`
    CopySelfOnEmail           bool              `json:"copy_self_on_email,omitempty"`
    DateFormat                string            `json:"date_format"`
    TimeFormat                string            `json:"time_format"`
    RelativeDateInChangeTable bool              `json:"relative_date_in_change_table,omitempty"`
    SizeBarInChangeTable      bool              `json:"size_bar_in_change_table,omitempty"`
    LegacycidInChangeTable    bool              `json:"legacycid_in_change_table,omitempty"`
    MuteCommonPathPrefixes    bool              `json:"mute_common_path_prefixes,omitempty"`
    ReviewCategoryStrategy    string            `json:"review_category_strategy"`
    DiffView                  string            `json:"diff_view"`
    My                        []TopMenuItemInfo `json:"my"`
    URLAliases                string            `json:"url_aliases,omitempty"`
}

PreferencesInfo entity contains information about a user’s preferences.

type PreferencesInput Uses

type PreferencesInput struct {
    ChangesPerPage            int               `json:"changes_per_page,omitempty"`
    ShowSiteHeader            bool              `json:"show_site_header,omitempty"`
    UseFlashClipboard         bool              `json:"use_flash_clipboard,omitempty"`
    DownloadScheme            string            `json:"download_scheme,omitempty"`
    DownloadCommand           string            `json:"download_command,omitempty"`
    CopySelfOnEmail           bool              `json:"copy_self_on_email,omitempty"`
    DateFormat                string            `json:"date_format,omitempty"`
    TimeFormat                string            `json:"time_format,omitempty"`
    RelativeDateInChangeTable bool              `json:"relative_date_in_change_table,omitempty"`
    SizeBarInChangeTable      bool              `json:"size_bar_in_change_table,omitempty"`
    LegacycidInChangeTable    bool              `json:"legacycid_in_change_table,omitempty"`
    MuteCommonPathPrefixes    bool              `json:"mute_common_path_prefixes,omitempty"`
    ReviewCategoryStrategy    string            `json:"review_category_strategy,omitempty"`
    DiffView                  string            `json:"diff_view,omitempty"`
    My                        []TopMenuItemInfo `json:"my,omitempty"`
    URLAliases                string            `json:"url_aliases,omitempty"`
}

PreferencesInput entity contains information for setting the user preferences. Fields which are not set will not be updated.

type ProblemInfo Uses

type ProblemInfo struct {
    Message string `json:"message"`
    Status  string `json:"status,omitempty"`
    Outcome string `json:"outcome,omitempty"`
}

ProblemInfo entity contains a description of a potential consistency problem with a change. These are not related to the code review process, but rather indicate some inconsistency in Gerrit’s database or repository metadata related to the enclosing change.

type ProjectAccessInfo Uses

type ProjectAccessInfo struct {
    Revision      string                       `json:"revision"`
    InheritsFrom  ProjectInfo                  `json:"inherits_from"`
    Local         map[string]AccessSectionInfo `json:"local"`
    IsOwner       bool                         `json:"is_owner"`
    OwnerOf       []string                     `json:"owner_of"`
    CanUpload     bool                         `json:"can_upload"`
    CanAdd        bool                         `json:"can_add"`
    ConfigVisible bool                         `json:"config_visible"`
}

ProjectAccessInfo entity contains information about the access rights for a project.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-access.html#project-access-info

type ProjectBaseOptions Uses

type ProjectBaseOptions struct {
    // Limit the number of projects to be included in the results.
    Limit int `url:"n,omitempty"`

    // Skip the given number of branches from the beginning of the list.
    Skip string `url:"s,omitempty"`
}

ProjectBaseOptions specifies the really basic options for projects and sub functionality (e.g. Tags)

type ProjectDescriptionInput Uses

type ProjectDescriptionInput struct {
    Description   string `json:"description,omitempty"`
    CommitMessage string `json:"commit_message,omitempty"`
}

ProjectDescriptionInput entity contains information for setting a project description.

type ProjectInfo Uses

type ProjectInfo struct {
    ID          string            `json:"id"`
    Name        string            `json:"name"`
    Parent      string            `json:"parent,omitempty"`
    Description string            `json:"description,omitempty"`
    State       string            `json:"state,omitempty"`
    Branches    map[string]string `json:"branches,omitempty"`
    WebLinks    []WebLinkInfo     `json:"web_links,omitempty"`
}

ProjectInfo entity contains information about a project.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#project-info

type ProjectInput Uses

type ProjectInput struct {
    Name                             string                       `json:"name,omitempty"`
    Parent                           string                       `json:"parent,omitempty"`
    Description                      string                       `json:"description,omitempty"`
    PermissionsOnly                  bool                         `json:"permissions_only"`
    CreateEmptyCommit                bool                         `json:"create_empty_commit"`
    SubmitType                       string                       `json:"submit_type,omitempty"`
    Branches                         []string                     `json:"branches,omitempty"`
    Owners                           []string                     `json:"owners,omitempty"`
    UseContributorAgreements         string                       `json:"use_contributor_agreements"`
    UseSignedOffBy                   string                       `json:"use_signed_off_by"`
    CreateNewChangeForAllNotInTarget string                       `json:"create_new_change_for_all_not_in_target"`
    UseContentMerge                  string                       `json:"use_content_merge"`
    RequireChangeID                  string                       `json:"require_change_id"`
    MaxObjectSizeLimit               string                       `json:"max_object_size_limit,omitempty"`
    PluginConfigValues               map[string]map[string]string `json:"plugin_config_values,omitempty"`
}

ProjectInput entity contains information for the creation of a new project.

type ProjectOptions Uses

type ProjectOptions struct {
    ProjectBaseOptions

    // Limit the results to the projects having the specified branch and include the sha1 of the branch in the results.
    Branch string `url:"b,omitempty"`

    // Include project description in the results.
    Description bool `url:"d,omitempty"`

    // Limit the results to those projects that start with the specified prefix.
    Prefix string `url:"p,omitempty"`

    // Limit the results to those projects that match the specified regex.
    // Boundary matchers '^' and '$' are implicit.
    // For example: the regex 'test.*' will match any projects that start with 'test' and regex '.*test' will match any project that end with 'test'.
    Regex string `url:"r,omitempty"`

    // Skip the given number of projects from the beginning of the list.
    Skip string `url:"S,omitempty"`

    // Limit the results to those projects that match the specified substring.
    Substring string `url:"m,omitempty"`

    // Get projects inheritance in a tree-like format.
    // This option does not work together with the branch option.
    Tree bool `url:"t,omitempty"`

    // Get projects with specified type: ALL, CODE, PERMISSIONS.
    Type string `url:"type,omitempty"`
}

ProjectOptions specifies the parameters to the ProjectsService.ListProjects.

type ProjectParentInput Uses

type ProjectParentInput struct {
    Parent        string `json:"parent"`
    CommitMessage string `json:"commit_message,omitempty"`
}

ProjectParentInput entity contains information for setting a project parent.

type ProjectsService Uses

type ProjectsService struct {
    // contains filtered or unexported fields
}

ProjectsService contains Project related REST endpoints

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html

func (*ProjectsService) BanCommit Uses

func (s *ProjectsService) BanCommit(projectName string, input *BanInput) (*BanResultInfo, *Response, error)

BanCommit marks commits as banned for the project. If a commit is banned Gerrit rejects every push that includes this commit with contains banned commit ...

Note: This REST endpoint only marks the commits as banned, but it does not remove the commits from the history of any central branch. This needs to be done manually. The commits to be banned must be specified in the request body as a BanInput entity.

The caller must be project owner.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#ban-commit

func (*ProjectsService) CreateBranch Uses

func (s *ProjectsService) CreateBranch(projectName, branchID string, input *BranchInput) (*BranchInfo, *Response, error)

CreateBranch creates a new branch. In the request body additional data for the branch can be provided as BranchInput.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#create-branch

func (*ProjectsService) CreateProject Uses

func (s *ProjectsService) CreateProject(projectName string, input *ProjectInput) (*ProjectInfo, *Response, error)

CreateProject creates a new project.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#create-project

func (*ProjectsService) DeleteBranch Uses

func (s *ProjectsService) DeleteBranch(projectName, branchID string) (*Response, error)

DeleteBranch deletes a branch.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#delete-branch

func (*ProjectsService) DeleteBranches Uses

func (s *ProjectsService) DeleteBranches(projectName string, input *DeleteBranchesInput) (*Response, error)

DeleteBranches delete one or more branches. If some branches could not be deleted, the response is “409 Conflict” and the error message is contained in the response body.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#delete-branches

func (*ProjectsService) DeleteDashboard Uses

func (s *ProjectsService) DeleteDashboard(projectName, dashboardID string, input *DashboardInput) (*Response, error)

DeleteDashboard deletes a project dashboard. Currently only supported for the default dashboard.

The request body does not need to include a DashboardInput entity if no commit message is specified. Please note that some proxies prohibit request bodies for DELETE requests.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#delete-dashboard

func (*ProjectsService) DeleteProjectDescription Uses

func (s *ProjectsService) DeleteProjectDescription(projectName string) (*Response, error)

DeleteProjectDescription deletes the description of a project. The request body does not need to include a ProjectDescriptionInput entity if no commit message is specified.

Please note that some proxies prohibit request bodies for DELETE requests. In this case, if you want to specify a commit message, use PUT to delete the description.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#delete-project-description

func (*ProjectsService) GetBranch Uses

func (s *ProjectsService) GetBranch(projectName, branchID string) (*BranchInfo, *Response, error)

GetBranch retrieves a branch of a project.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-branch

func (*ProjectsService) GetBranchContent Uses

func (s *ProjectsService) GetBranchContent(projectName, branchID, fileID string) (string, *Response, error)

GetBranchContent gets the content of a file from the HEAD revision of a certain branch. The content is returned as base64 encoded string.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-content

func (*ProjectsService) GetChildProject Uses

func (s *ProjectsService) GetChildProject(projectName, childProjectName string, opt *ChildProjectOptions) (*ProjectInfo, *Response, error)

GetChildProject retrieves a child project. If a non-direct child project should be retrieved the parameter recursive must be set.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-child-project

func (*ProjectsService) GetCommit Uses

func (s *ProjectsService) GetCommit(projectName, commitID string) (*CommitInfo, *Response, error)

GetCommit retrieves a commit of a project. The commit must be visible to the caller.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-commit

func (*ProjectsService) GetCommitContent Uses

func (s *ProjectsService) GetCommitContent(projectName, commitID, fileID string) (string, *Response, error)

GetCommitContent gets the content of a file from a certain commit. The content is returned as base64 encoded string.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html##get-content-from-commit

func (*ProjectsService) GetConfig Uses

func (s *ProjectsService) GetConfig(projectName string) (*ConfigInfo, *Response, error)

GetConfig gets some configuration information about a project. Note that this config info is not simply the contents of project.config; it generally contains fields that may have been inherited from parent projects.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-config

func (*ProjectsService) GetDashboard Uses

func (s *ProjectsService) GetDashboard(projectName, dashboardName string) (*DashboardInfo, *Response, error)

GetDashboard list custom dashboards for a project.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-dashboard

func (*ProjectsService) GetHEAD Uses

func (s *ProjectsService) GetHEAD(projectName string) (string, *Response, error)

GetHEAD retrieves for a project the name of the branch to which HEAD points.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-head

func (*ProjectsService) GetProject Uses

func (s *ProjectsService) GetProject(projectName string) (*ProjectInfo, *Response, error)

GetProject retrieves a project.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-project

func (*ProjectsService) GetProjectDescription Uses

func (s *ProjectsService) GetProjectDescription(projectName string) (string, *Response, error)

GetProjectDescription retrieves the description of a project.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-project-description

func (*ProjectsService) GetProjectParent Uses

func (s *ProjectsService) GetProjectParent(projectName string) (string, *Response, error)

GetProjectParent retrieves the name of a project’s parent project. For the All-Projects root project an empty string is returned.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-project-parent

func (*ProjectsService) GetReflog Uses

func (s *ProjectsService) GetReflog(projectName, branchID string) (*[]ReflogEntryInfo, *Response, error)

GetReflog gets the reflog of a certain branch. The caller must be project owner.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-reflog

func (*ProjectsService) GetRepositoryStatistics Uses

func (s *ProjectsService) GetRepositoryStatistics(projectName string) (*RepositoryStatisticsInfo, *Response, error)

GetRepositoryStatistics return statistics for the repository of a project.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-repository-statistics

func (*ProjectsService) GetTag Uses

func (s *ProjectsService) GetTag(projectName, tagName string) (*TagInfo, *Response, error)

GetTag retrieves a tag of a project.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-tag

func (*ProjectsService) ListBranches Uses

func (s *ProjectsService) ListBranches(projectName string, opt *BranchOptions) (*[]BranchInfo, *Response, error)

ListBranches list the branches of a project.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#list-branches

func (*ProjectsService) ListChildProjects Uses

func (s *ProjectsService) ListChildProjects(projectName string, opt *ChildProjectOptions) (*[]ProjectInfo, *Response, error)

ListChildProjects lists the direct child projects of a project.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#list-child-projects

func (*ProjectsService) ListDashboards Uses

func (s *ProjectsService) ListDashboards(projectName string) (*[]DashboardInfo, *Response, error)

ListDashboards list custom dashboards for a project.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#list-dashboards

func (*ProjectsService) ListProjects Uses

func (s *ProjectsService) ListProjects(opt *ProjectOptions) (*map[string]ProjectInfo, *Response, error)

ListProjects lists the projects accessible by the caller. This is the same as using the ls-projects command over SSH, and accepts the same options as query parameters. The entries in the map are sorted by project name.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#list-projects

Code:

instance := "https://chromium-review.googlesource.com/"
client, err := gerrit.NewClient(instance, nil)
if err != nil {
    panic(err)
}

opt := &gerrit.ProjectOptions{
    Description: true,
    Prefix:      "infra/infra/infra_l",
}
projects, _, err := client.Projects.ListProjects(opt)
if err != nil {
    panic(err)
}

for name, p := range *projects {
    fmt.Printf("%s - State: %s\n", name, p.State)
}

Output:

infra/infra/infra_libs - State: ACTIVE

func (*ProjectsService) ListTags Uses

func (s *ProjectsService) ListTags(projectName string, opt *ProjectBaseOptions) (*[]TagInfo, *Response, error)

ListTags list the tags of a project.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#list-tags

func (*ProjectsService) RunGC Uses

func (s *ProjectsService) RunGC(projectName string, input *GCInput) (*Response, error)

RunGC runs the Git garbage collection for the repository of a project. The response is the streamed output of the garbage collection.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#run-gc

func (*ProjectsService) SetConfig Uses

func (s *ProjectsService) SetConfig(projectName string, input *ConfigInput) (*ConfigInfo, *Response, error)

SetConfig sets the configuration of a project. The new configuration must be provided in the request body as a ConfigInput entity.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#set-config

func (*ProjectsService) SetDashboard Uses

func (s *ProjectsService) SetDashboard(projectName, dashboardID string, input *DashboardInput) (*DashboardInfo, *Response, error)

SetDashboard updates/Creates a project dashboard. Currently only supported for the default dashboard.

The creation/update information for the dashboard must be provided in the request body as a DashboardInput entity.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#set-dashboard

func (*ProjectsService) SetHEAD Uses

func (s *ProjectsService) SetHEAD(projectName string, input *HeadInput) (*string, *Response, error)

SetHEAD sets HEAD for a project. The new ref to which HEAD should point must be provided in the request body inside a HeadInput entity.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#set-head

func (*ProjectsService) SetProjectDescription Uses

func (s *ProjectsService) SetProjectDescription(projectName string, input *ProjectDescriptionInput) (*string, *Response, error)

SetProjectDescription sets the description of a project. The new project description must be provided in the request body inside a ProjectDescriptionInput entity.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#set-project-description

func (*ProjectsService) SetProjectParent Uses

func (s *ProjectsService) SetProjectParent(projectName string, input *ProjectParentInput) (*string, *Response, error)

SetProjectParent sets the parent project for a project. The new name of the parent project must be provided in the request body inside a ProjectParentInput entity.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#set-project-parent

type QueryChangeOptions Uses

type QueryChangeOptions struct {
    QueryOptions

    // The S or start query parameter can be supplied to skip a number of changes from the list.
    Skip  int `url:"S,omitempty"`
    Start int `url:"start,omitempty"`

    ChangeOptions
}

QueryChangeOptions specifies the parameters to the ChangesService.QueryChanges.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-changes

type QueryLimitInfo Uses

type QueryLimitInfo struct {
    Min int `json:"min"`
    Max int `json:"max"`
}

QueryLimitInfo entity contains information about the Query Limit of a user.

type QueryOptions Uses

type QueryOptions struct {
    // Query parameter
    // Clients are allowed to specify more than one query by setting the q parameter multiple times.
    // In this case the result is an array of arrays, one per query in the same order the queries were given in.
    //
    // Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/user-search.html#_search_operators
    Query []string `url:"q,omitempty"`

    // The n parameter can be used to limit the returned results.
    // If the n query parameter is supplied and additional changes exist that match the query beyond the end, the last change object has a _more_changes: true JSON field set.
    Limit int `url:"n,omitempty"`
}

QueryOptions specifies global parameters to query changes / reviewers.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-changes

type RebaseInput Uses

type RebaseInput struct {
    Base string `json:"base,omitempty"`
}

RebaseInput entity contains information for changing parent when rebasing.

type ReceiveInfo Uses

type ReceiveInfo struct {
    EnableSignedPush bool `json:"enableSignedPush,omitempty"`
}

ReceiveInfo entity contains information about the configuration of git-receive-pack behavior on the server.

type RefUpdate Uses

type RefUpdate struct {
    OldRev  string `json:"oldRev"`
    NewRev  string `json:"newRev"`
    RefName string `json:"refName"`
    Project string `json:"project"`
}

RefUpdate contains data about a reference update.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/json.html#refUpdate

type ReflogEntryInfo Uses

type ReflogEntryInfo struct {
    OldID   string        `json:"old_id"`
    NewID   string        `json:"new_id"`
    Who     GitPersonInfo `json:"who"`
    Comment string        `json:"comment"`
}

ReflogEntryInfo entity describes an entry in a reflog.

type RelatedChangeAndCommitInfo Uses

type RelatedChangeAndCommitInfo struct {
    ChangeID              string     `json:"change_id,omitempty"`
    Commit                CommitInfo `json:"commit"`
    ChangeNumber          int        `json:"_change_number,omitempty"`
    RevisionNumber        int        `json:"_revision_number,omitempty"`
    CurrentRevisionNumber int        `json:"_current_revision_number,omitempty"`
    Status                string     `json:"status,omitempty"`
}

RelatedChangeAndCommitInfo entity contains information about a related change and commit.

type RelatedChangesInfo Uses

type RelatedChangesInfo struct {
    Changes []RelatedChangeAndCommitInfo `json:"changes"`
}

RelatedChangesInfo entity contains information about related changes.

type RepositoryStatisticsInfo Uses

type RepositoryStatisticsInfo struct {
    NumberOfLooseObjects  int `json:"number_of_loose_objects"`
    NumberOfLooseRefs     int `json:"number_of_loose_refs"`
    NumberOfPackFiles     int `json:"number_of_pack_files"`
    NumberOfPackedObjects int `json:"number_of_packed_objects"`
    NumberOfPackedRefs    int `json:"number_of_packed_refs"`
    SizeOfLooseObjects    int `json:"size_of_loose_objects"`
    SizeOfPackedObjects   int `json:"size_of_packed_objects"`
}

RepositoryStatisticsInfo entity contains information about statistics of a Git repository.

type Response Uses

type Response struct {
    *http.Response
}

Response is a Gerrit API response. This wraps the standard http.Response returned from Gerrit.

type RestoreInput Uses

type RestoreInput struct {
    Message string `json:"message,omitempty"`
}

RestoreInput entity contains information for restoring a change.

type RevertInput Uses

type RevertInput struct {
    Message string `json:"message,omitempty"`
}

RevertInput entity contains information for reverting a change.

type ReviewInfo Uses

type ReviewInfo struct {
    Labels map[string]int `json:"labels"`
}

ReviewInfo entity contains information about a review.

type ReviewInput Uses

type ReviewInput struct {
    Message               string                         `json:"message,omitempty"`
    Tag                   string                         `json:"tag,omitempty"`
    Labels                map[string]string              `json:"labels,omitempty"`
    Comments              map[string][]CommentInput      `json:"comments,omitempty"`
    RobotComments         map[string][]RobotCommentInput `json:"robot_comments,omitempty"`
    StrictLabels          bool                           `json:"strict_labels,omitempty"`
    Drafts                string                         `json:"drafts,omitempty"`
    Notify                string                         `json:"notify,omitempty"`
    OmitDuplicateComments bool                           `json:"omit_duplicate_comments,omitempty"`
    OnBehalfOf            string                         `json:"on_behalf_of,omitempty"`
}

ReviewInput entity contains information for adding a review to a revision.

type ReviewResult Uses

type ReviewResult struct {
    ReviewInfo
    Reviewers map[string]AddReviewerResult `json:"reviewers,omitempty"`
    Ready     bool                         `json:"ready,omitempty"`
}

ReviewResult entity contains information regarding the updates that were made to a review.

type ReviewerInfo Uses

type ReviewerInfo struct {
    AccountInfo
    Approvals map[string]string `json:"approvals"`
}

ReviewerInfo entity contains information about a reviewer and its votes on a change.

type ReviewerInput Uses

type ReviewerInput struct {
    Reviewer  string `json:"reviewer"`
    Confirmed bool   `json:"confirmed,omitempty"`
}

ReviewerInput entity contains information for adding a reviewer to a change.

type RevisionInfo Uses

type RevisionInfo struct {
    Draft             bool                  `json:"draft,omitempty"`
    Number            int                   `json:"_number"`
    Created           Timestamp             `json:"created"`
    Uploader          AccountInfo           `json:"uploader"`
    Ref               string                `json:"ref"`
    Fetch             map[string]FetchInfo  `json:"fetch"`
    Commit            CommitInfo            `json:"commit,omitempty"`
    Files             map[string]FileInfo   `json:"files,omitempty"`
    Actions           map[string]ActionInfo `json:"actions,omitempty"`
    Reviewed          bool                  `json:"reviewed,omitempty"`
    MessageWithFooter string                `json:"messageWithFooter,omitempty"`
}

RevisionInfo entity contains information about a patch set.

type RobotCommentInfo Uses

type RobotCommentInfo struct {
    CommentInfo

    // The ID of the robot that generated this comment.
    RobotID string `json:"robot_id"`
    // An ID of the run of the robot.
    RobotRunID string `json:"robot_run_id"`
    // URL to more information.
    URL string `json:"url,omitempty"`
    // Robot specific properties as map that maps arbitrary keys to values.
    Properties map[string]string `json:"properties,omitempty"`
    // Suggested fixes for this robot comment as a list of FixSuggestionInfo
    // entities.
    FixSuggestions *FixSuggestionInfo `json:"fix_suggestions,omitempty"`
}

RobotCommentInfo entity contains information about a robot inline comment RobotCommentInfo has the same fields as CommentInfo. In addition RobotCommentInfo has the following fields: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#robot-comment-info

type RobotCommentInput Uses

type RobotCommentInput struct {
    CommentInput

    // The ID of the robot that generated this comment.
    RobotID string `json:"robot_id"`
    // An ID of the run of the robot.
    RobotRunID string `json:"robot_run_id"`
    // URL to more information.
    URL string `json:"url,omitempty"`
    // Robot specific properties as map that maps arbitrary keys to values.
    Properties *map[string]*string `json:"properties,omitempty"`
    // Suggested fixes for this robot comment as a list of FixSuggestionInfo
    // entities.
    FixSuggestions *FixSuggestionInfo `json:"fix_suggestions,omitempty"`
}

RobotCommentInput entity contains information for creating an inline robot comment. https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#robot-comment-input

type RuleInput Uses

type RuleInput struct {
    Rule    string `json:"rule"`
    Filters string `json:"filters,omitempty"`
}

RuleInput entity contains information to test a Prolog rule.

type SSHKeyInfo Uses

type SSHKeyInfo struct {
    Seq          int    `json:"seq"`
    SSHPublicKey string `json:"ssh_public_key"`
    EncodedKey   string `json:"encoded_key"`
    Algorithm    string `json:"algorithm"`
    Comment      string `json:"comment,omitempty"`
    Valid        bool   `json:"valid"`
}

SSHKeyInfo entity contains information about an SSH key of a user.

type SSHdInfo Uses

type SSHdInfo struct{}

SSHdInfo entity contains information about Gerrit configuration from the sshd section.

type ServerInfo Uses

type ServerInfo struct {
    Auth       AuthInfo          `json:"auth"`
    Change     ChangeConfigInfo  `json:"change"`
    Download   DownloadInfo      `json:"download"`
    Gerrit     Info              `json:"gerrit"`
    Gitweb     map[string]string `json:"gitweb,omitempty"`
    Plugin     PluginConfigInfo  `json:"plugin"`
    Receive    ReceiveInfo       `json:"receive,omitempty"`
    SSHd       SSHdInfo          `json:"sshd,omitempty"`
    Suggest    SuggestInfo       `json:"suggest"`
    URLAliases map[string]string `json:"url_aliases,omitempty"`
    User       UserConfigInfo    `json:"user"`
}

ServerInfo entity contains information about the configuration of the Gerrit server.

type SubmitInfo Uses

type SubmitInfo struct {
    Status     string `json:"status"`
    OnBehalfOf string `json:"on_behalf_of,omitempty"`
}

SubmitInfo entity contains information about the change status after submitting.

type SubmitInput Uses

type SubmitInput struct {
    WaitForMerge bool `json:"wait_for_merge"`
}

SubmitInput entity contains information for submitting a change.

type SubmitRecord Uses

type SubmitRecord struct {
    Status       string                            `json:"status"`
    Ok           map[string]map[string]AccountInfo `json:"ok,omitempty"`
    Reject       map[string]map[string]AccountInfo `json:"reject,omitempty"`
    Need         map[string]interface{}            `json:"need,omitempty"`
    May          map[string]map[string]AccountInfo `json:"may,omitempty"`
    Impossible   map[string]interface{}            `json:"impossible,omitempty"`
    ErrorMessage string                            `json:"error_message,omitempty"`
}

SubmitRecord entity describes results from a submit_rule.

type SuggestInfo Uses

type SuggestInfo struct {
    From int `json:"from"`
}

SuggestInfo entity contains information about Gerrit configuration from the suggest section.

type SuggestedReviewerInfo Uses

type SuggestedReviewerInfo struct {
    Account AccountInfo   `json:"account,omitempty"`
    Group   GroupBaseInfo `json:"group,omitempty"`
}

SuggestedReviewerInfo entity contains information about a reviewer that can be added to a change (an account or a group).

type SummaryInfo Uses

type SummaryInfo struct {
    TaskSummary   TaskSummaryInfo `json:"task_summary"`
    MemSummary    MemSummaryInfo  `json:"mem_summary"`
    ThreadSummary ThemeInfo       `json:"thread_summary"`
    JVMSummary    JvmSummaryInfo  `json:"jvm_summary,omitempty"`
}

SummaryInfo entity contains information about the current state of the server.

type SummaryOptions Uses

type SummaryOptions struct {
    // JVM includes a JVM summary.
    JVM bool `url:"jvm,omitempty"`
    // GC requests a Java garbage collection before computing the information about the Java memory heap.
    GC  bool `url:"gc,omitempty"`
}

SummaryOptions specifies the different options for the GetSummary call.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#get-summary

type TagInfo Uses

type TagInfo struct {
    Ref      string        `json:"ref"`
    Revision string        `json:"revision"`
    Object   string        `json:"object"`
    Message  string        `json:"message"`
    Tagger   GitPersonInfo `json:"tagger"`
    Created  *Timestamp    `json:"created,omitempty"`
}

TagInfo entity contains information about a tag.

type TaskInfo Uses

type TaskInfo struct {
    ID         string `json:"id"`
    State      string `json:"state"`
    StartTime  string `json:"start_time"`
    Delay      int    `json:"delay"`
    Command    string `json:"command"`
    RemoteName string `json:"remote_name,omitempty"`
    Project    string `json:"project,omitempty"`
}

TaskInfo entity contains information about a task in a background work queue.

type TaskSummaryInfo Uses

type TaskSummaryInfo struct {
    Total    int `json:"total,omitempty"`
    Running  int `json:"running,omitempty"`
    Ready    int `json:"ready,omitempty"`
    Sleeping int `json:"sleeping,omitempty"`
}

TaskSummaryInfo entity contains information about the current tasks.

type ThemeInfo Uses

type ThemeInfo struct {
    CSS    string `type:"css,omitempty"`
    Header string `type:"header,omitempty"`
    Footer string `type:"footer,omitempty"`
}

ThemeInfo entity describes a theme.

type ThreadSummaryInfo Uses

type ThreadSummaryInfo struct {
    CPUs    int                       `json:"cpus"`
    Threads int                       `json:"threads"`
    Counts  map[string]map[string]int `json:"counts"`
}

ThreadSummaryInfo entity contains information about the current threads.

type Timestamp Uses

type Timestamp struct {
    // Time is an instant in time. Its time zone must be UTC.
    time.Time
}

Timestamp represents an instant in time with nanosecond precision, in UTC time zone. It encodes to and from JSON in Gerrit's timestamp format. All exported methods of time.Time can be called on Timestamp.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api.html#timestamp

func (Timestamp) MarshalJSON Uses

func (t Timestamp) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface. The time is a quoted string in Gerrit's timestamp format. An error is returned if t.Time time zone is not UTC.

func (*Timestamp) UnmarshalJSON Uses

func (t *Timestamp) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface. The time is expected to be a quoted string in Gerrit's timestamp format.

type TopMenuEntryInfo Uses

type TopMenuEntryInfo struct {
    Name  string            `json:"name"`
    Items []TopMenuItemInfo `json:"items"`
}

TopMenuEntryInfo entity contains information about a top menu entry.

type TopMenuItemInfo Uses

type TopMenuItemInfo struct {
    URL    string `json:"url"`
    Name   string `json:"name"`
    Target string `json:"target"`
    ID     string `json:"id,omitempty"`
}

TopMenuItemInfo entity contains information about a menu item in a top menu entry.

type TopicInput Uses

type TopicInput struct {
    Topic string `json:"topic,omitempty"`
}

TopicInput entity contains information for setting a topic.

type UserConfigInfo Uses

type UserConfigInfo struct {
    AnonymousCowardName string `json:"anonymous_coward_name"`
}

UserConfigInfo entity contains information about Gerrit configuration from the user section.

type UsernameInput Uses

type UsernameInput struct {
    Username string `json:"username"`
}

UsernameInput entity contains information for setting the username for an account.

type WebLinkInfo Uses

type WebLinkInfo struct {
    Name     string `json:"name"`
    URL      string `json:"url"`
    ImageURL string `json:"image_url"`
}

WebLinkInfo entity describes a link to an external site.

Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#web-link-info

Package gerrit imports 17 packages (graph) and is imported by 14 packages. Updated 2019-01-20. Refresh now. Tools for package owners.