Documentation
¶
Overview ¶
Package github holds the values the GitHub client reads and the budget its callers spend: pull request states, explore candidates, rate limits and the priority a call is tagged with.
Index ¶
Constants ¶
const ( StateOpen = "OPEN" StateMerged = "MERGED" StateClosed = "CLOSED" )
Variables ¶
var ErrBudget = errors.New("GitHub budget low")
Functions ¶
Types ¶
type BudgetError ¶
BudgetError is a call refused because its bucket fell below the floor of its priority.
func (*BudgetError) Error ¶
func (e *BudgetError) Error() string
func (*BudgetError) Is ¶
func (e *BudgetError) Is(target error) bool
type Candidate ¶
type Candidate struct {
Ref pr.Ref `json:"ref"`
URL string `json:"url"`
Title string `json:"title"`
Author string `json:"author"`
State string `json:"state"`
IsDraft bool `json:"draft"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Additions int `json:"additions"`
Deletions int `json:"deletions"`
ChangedFiles int `json:"changed_files"`
HeadBranch string `json:"head"`
BaseBranch string `json:"base"`
ReviewDecision string `json:"review_decision"`
ReviewRequests []string `json:"review_requests"` // logins and team:org/slug
ChecksState string `json:"checks"`
Comments int `json:"comments"`
// MyReview is the viewer's latest review state, "" when none.
MyReview string `json:"my_review"`
MyReviewOnHead bool `json:"my_review_on_head"`
}
Candidate is a pull request Explore found, with what deciding whether to help on it needs.
type CandidatePage ¶
type Priority ¶
type Priority uint8
Priority orders who may spend the budget when it runs low.
func PriorityOf ¶
PriorityOf is the priority ctx is tagged with.