Documentation
¶
Index ¶
- type Check
- type Comment
- type Commit
- type CreatePullRequestRequest
- type File
- type GitHubService
- type MergePullRequestRequest
- type PRFilter
- type PagedPullRequests
- type PullRequest
- type PullRequestDetail
- type PullRequestPage
- type RemoteBranch
- type RemoteRepository
- type Review
- type ReviewRequest
- type ReviewSummary
- type WorkflowRun
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Check ¶
type Check struct {
ID int64 `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
Conclusion string `json:"conclusion"`
URL string `json:"url"`
// StartedAt and CompletedAt are absent for commit statuses and for runs
// that have not started or finished.
StartedAt *time.Time `json:"started_at,omitempty"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
}
type GitHubService ¶
type GitHubService interface {
Repository(context.Context, string) (RemoteRepository, error)
Branches(context.Context, string) ([]RemoteBranch, error)
PullRequests(context.Context, string, PRFilter) ([]PullRequest, error)
PullRequest(context.Context, string, int) (PullRequestDetail, error)
CreatePullRequest(context.Context, CreatePullRequestRequest) (PullRequest, error)
ReviewPullRequest(context.Context, ReviewRequest) error
ReadyPullRequest(context.Context, string, int) error
ClosePullRequest(context.Context, string, int) error
ReopenPullRequest(context.Context, string, int) error
MergePullRequest(context.Context, MergePullRequestRequest) error
Comment(context.Context, string, int, string) error
Checks(context.Context, string, string) ([]Check, error)
WorkflowRuns(context.Context, string, string) ([]WorkflowRun, error)
}
type MergePullRequestRequest ¶
type PagedPullRequests ¶ added in v0.2.10
type PagedPullRequests interface {
PullRequestPage(context.Context, string, PRFilter, int) (PullRequestPage, error)
}
PagedPullRequests is optional so provider adapters can migrate separately.
type PullRequest ¶
type PullRequest struct {
Number int `json:"number"`
Title string `json:"title"`
Body string `json:"body"`
State string `json:"state"`
Head string `json:"head"`
HeadRepository string `json:"head_repository,omitempty"`
Base string `json:"base"`
HeadSHA string `json:"head_sha"`
URL string `json:"url"`
Draft bool `json:"draft"`
Author string `json:"author"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
NodeID string `json:"node_id"`
}
type PullRequestDetail ¶
type PullRequestDetail struct {
PullRequest
Mergeable string `json:"mergeable"`
// Additions, Deletions and ChangedFiles are GitHub's own totals, so they
// stay correct when Files is truncated.
Additions int `json:"additions"`
Deletions int `json:"deletions"`
ChangedFiles int `json:"changed_files"`
// RequestedReviewers lists users whose review is still awaited.
RequestedReviewers []string `json:"requested_reviewers"`
ReviewSummary ReviewSummary `json:"review_summary"`
// BehindBy is the number of base commits missing from head. Nil when it
// is unknown or irrelevant (closed PRs).
BehindBy *int `json:"behind_by,omitempty"`
Comments []Comment `json:"comments"`
Reviews []Review `json:"reviews"`
Commits []Commit `json:"commits"`
Files []File `json:"files"`
}
type PullRequestPage ¶ added in v0.2.10
type PullRequestPage struct {
Items []PullRequest
NextPage int
// NotModified reports that GitHub answered the page with 304 Not Modified
// and Items came from the client's conditional-request cache.
NotModified bool
}
type RemoteBranch ¶
type RemoteRepository ¶
type ReviewRequest ¶
type ReviewSummary ¶ added in v0.2.18
type ReviewSummary struct {
Approvals int `json:"approvals"`
ChangesRequested int `json:"changes_requested"`
}
ReviewSummary counts each reviewer's standing verdict: their latest approving or changes-requesting review that has not been dismissed.
func SummarizeReviews ¶ added in v0.2.18
func SummarizeReviews(reviews []Review) ReviewSummary
SummarizeReviews expects reviews in chronological order, as GitHub lists them.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package app implements GitHub's domain API without a gh executable.
|
Package app implements GitHub's domain API without a gh executable. |
|
Compatibility names preserve CLI/TUI behavior while the daemon and web use the context-aware domain interfaces.
|
Compatibility names preserve CLI/TUI behavior while the daemon and web use the context-aware domain interfaces. |