Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnrichPushEvent ¶
func EnrichPushEvent(ev *Event)
EnrichPushEvent fetches compare stats and populates the event's detail cache.
Types ¶
type CompareResult ¶
type CompareResult struct {
TotalCommits int `json:"total_commits"`
Files []struct {
Filename string `json:"filename"`
Additions int `json:"additions"`
Deletions int `json:"deletions"`
Changes int `json:"changes"`
} `json:"files"`
}
CompareResult holds diff stats from the compare API.
func FetchCompare ¶
func FetchCompare(repo, base, head string) (*CompareResult, error)
FetchCompare gets diff stats between two commits.
type Event ¶
type Event struct {
ID string `json:"id"`
Type string `json:"type"`
Actor Actor `json:"actor"`
Repo Repo `json:"repo"`
Payload Payload `json:"payload"`
CreatedAt time.Time `json:"created_at"`
CompareData *CompareResult `json:"-"`
}
func FetchEvents ¶
FetchEvents fetches recent events for a repo using the gh CLI. page is 1-indexed; each page returns up to 30 events from the API.
type Payload ¶
type Payload struct {
Action string `json:"action,omitempty"`
Ref string `json:"ref,omitempty"`
RefType string `json:"ref_type,omitempty"`
Size int `json:"size,omitempty"`
Before string `json:"before,omitempty"`
Head string `json:"head,omitempty"`
Commits []Commit `json:"commits,omitempty"`
PullRequest *PullRequest `json:"pull_request,omitempty"`
Issue *Issue `json:"issue,omitempty"`
Comment *Comment `json:"comment,omitempty"`
Release *Release `json:"release,omitempty"`
}
type PullRequest ¶
Click to show internal directories.
Click to hide internal directories.