Documentation
¶
Overview ¶
Package client implements a client that can handle multiple gerrit instances derived from http://github.com/andygrunwald/go-gerrit
Index ¶
- Constants
- type ChangeInfo
- type Client
- func (c *Client) GetBranchRevision(instance, project, branch string) (string, error)
- func (c *Client) QueryChanges(lastUpdate time.Time, rateLimit int) map[string][]ChangeInfo
- func (c *Client) SetReview(instance, id, revision, message string, labels map[string]string) error
- func (c *Client) Start(cookiefilePath string)
- type FileInfo
- type ProjectsFlag
- type RevisionInfo
Constants ¶
View Source
const (
// LGTM means all presubmits passed, but need someone else to approve before merge.
LGTM = "+1"
// LBTM means some presubmits failed, perfer not merge.
LBTM = "-1"
// CodeReview is the default gerrit code review label
CodeReview = "Code-Review"
// GerritID identifies a gerrit change
GerritID = "prow.k8s.io/gerrit-id"
// GerritInstance is the gerrit host url
GerritInstance = "prow.k8s.io/gerrit-instance"
// GerritRevision is the SHA of current patchset from a gerrit change
GerritRevision = "prow.k8s.io/gerrit-revision"
// GerritReportLabel is the gerrit label prow will cast vote on, fallback to CodeReview label if unset
GerritReportLabel = "prow.k8s.io/gerrit-report-label"
// Merged status indicates a Gerrit change has been merged
Merged = "MERGED"
// New status indicates a Gerrit change is new (ie pending)
New = "NEW"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client holds a instance:handler map
func NewClient ¶
func NewClient(instances map[string][]string) (*Client, error)
NewClient returns a new gerrit client
func (*Client) GetBranchRevision ¶
func (c *Client) GetBranchRevision(instance, project, branch string) (string, error)
GetBranchRevision returns SHA of HEAD of a branch
func (*Client) QueryChanges ¶
func (c *Client) QueryChanges(lastUpdate time.Time, rateLimit int) map[string][]ChangeInfo
QueryChanges queries for all changes from all projects after lastUpdate time returns an instance:changes map
type ProjectsFlag ¶
type ProjectsFlag map[string][]string
ProjectsFlag is the flag type for gerrit projects when initializing a gerrit client
Click to show internal directories.
Click to hide internal directories.