Documentation
¶
Index ¶
- Constants
- Variables
- type IMonorailService
- type MonorailIssue
- type MonorailService
- func (m *MonorailService) GetEmail(userName string) (*MonorailUser, error)
- func (m *MonorailService) GetIssue(issueName string) (*MonorailIssue, error)
- func (m *MonorailService) GetIssueLink(instance, id string) string
- func (m *MonorailService) MakeIssue(instance, owner, summary, description, status, priority, issueType string, ...) (*MonorailIssue, error)
- func (m *MonorailService) SearchIssuesWithPagination(instance, query string) ([]MonorailIssue, error)
- func (m *MonorailService) SetOwnerAndAddComment(instance, owner, comment, id string) error
- type MonorailUser
Constants ¶
View Source
const ( // Project specific field constants. ChromiumPriorityFieldName = "projects/chromium/fieldDefs/11" ChromiumTypeFieldName = "projects/chromium/fieldDefs/10" SkiaPriorityFieldName = "projects/skia/fieldDefs/9" SkiaTypeFieldName = "projects/skia/fieldDefs/8" RestrictViewGoogleLabelName = "Restrict-View-Google" )
Variables ¶
View Source
var ( ProjectToPriorityFieldNames = map[string]string{ // contains filtered or unexported fields } ProjectToTypeFieldNames = map[string]string{ // contains filtered or unexported fields } )
Functions ¶
This section is empty.
Types ¶
type IMonorailService ¶
type IMonorailService interface {
// GetEmail returns the registered email of the provided user name.
GetEmail(userName string) (*MonorailUser, error)
// SetOwnerAndAddComment sets the provided owner for the monorail issue with
// the provided comment.
SetOwnerAndAddComment(instance, owner, comment, id string) error
// GetIssueLink returns a link that points to the provided monorail issue.
GetIssueLink(instance, id string) string
// GetIssue returns a MonorailIssue object for the provided issue name.
// Issue names look like this: "projects/skia/issues/13158".
GetIssue(issueName string) (*MonorailIssue, error)
// MakeIssue creates a new monorail issue.
MakeIssue(instance, owner, summary, description, status, priority, issueType string, labels, componentDefIDs, ccUsers []string) (*MonorailIssue, error)
// SearchIssuesWithPagination returns monorail issue results by autoamtically
// paginating till end of results.
// Monorail results are limited to 100 (see https://source.chromium.org/chromium/infra/infra/+/master:appengine/monorail/api/v3/api_proto/issues.proto;l=179).
// It paginates till all results are received.
SearchIssuesWithPagination(instance, query string) ([]MonorailIssue, error)
}
IMonorailService is the interface implemented by all monorail service impls.
type MonorailIssue ¶
type MonorailIssue struct {
Name string `json:"name"`
State struct {
Status string `json:"status"`
} `json:"status"`
FieldValues []struct {
Field string `json:"field"`
Value string `json:"value"`
} `json:"fieldValues"`
Owner struct {
User string `json:"user"`
} `json:"owner"`
CreatedTime time.Time `json:"createTime"`
ModifiedTime time.Time `json:"modifyTime"`
ClosedTime time.Time `json:"closeTime"`
Title string `json:"summary"`
}
type MonorailService ¶
func (*MonorailService) GetEmail ¶
func (m *MonorailService) GetEmail(userName string) (*MonorailUser, error)
GetEmail implements the IMonorailService interface.
func (*MonorailService) GetIssue ¶
func (m *MonorailService) GetIssue(issueName string) (*MonorailIssue, error)
GetIssue implements the IMonorailService interface.
func (*MonorailService) GetIssueLink ¶
func (m *MonorailService) GetIssueLink(instance, id string) string
GetIssueLink implements the IMonorailService interface.
func (*MonorailService) MakeIssue ¶
func (m *MonorailService) MakeIssue(instance, owner, summary, description, status, priority, issueType string, labels, componentDefIDs, ccUsers []string) (*MonorailIssue, error)
MakeIssue implements the IMonorailService interface. If the specified instance is not found in ProjectToPriorityFieldNames and/or ProjectToTypeFieldNames then the priority/type is instead added as labels instead of as custom fields.
func (*MonorailService) SearchIssuesWithPagination ¶
func (m *MonorailService) SearchIssuesWithPagination(instance, query string) ([]MonorailIssue, error)
SearchIssuesWithPagination implements the IMonorailService interface.
func (*MonorailService) SetOwnerAndAddComment ¶
func (m *MonorailService) SetOwnerAndAddComment(instance, owner, comment, id string) error
SetOwnerAndAddComment implements the IMonorailService interface.
type MonorailUser ¶
type MonorailUser struct {
DisplayName string `json:"displayName"`
}
Click to show internal directories.
Click to hide internal directories.