Documentation
¶
Index ¶
- Constants
- func NewClient(ctx context.Context) (*clientImpl, error)
- type ActionReader
- type ActionStatus
- type ActionWriter
- type Client
- type IssueFilter
- type IssueReader
- type IssueWriter
- type NotificationReader
- type PRFilter
- type PRReader
- type PRWriter
- type PageResult
- type ReleaseReader
- type WorkflowInput
Constants ¶
const MaxPaginationItems = 1000
MaxPaginationItems caps the total number of items accumulated across all pages for list endpoints (issues, PRs). Pagination stops once this many items have been collected. Exported so panels can apply the same cap on their own accumulation slices.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActionReader ¶
type ActionReader interface {
ListWorkflows(ctx context.Context, owner, repo string, opts *gh.ListOptions) ([]*gh.Workflow, error)
ListWorkflowsPage(ctx context.Context, owner, repo string, opts *gh.ListOptions) ([]*gh.Workflow, PageResult, error)
ListWorkflowRuns(ctx context.Context, owner, repo string, opts *gh.ListWorkflowRunsOptions) ([]*gh.WorkflowRun, error)
ListWorkflowRunsPage(ctx context.Context, owner, repo string, opts *gh.ListWorkflowRunsOptions) ([]*gh.WorkflowRun, PageResult, error)
GetWorkflowRun(ctx context.Context, owner, repo string, runID int64) (*gh.WorkflowRun, error)
ListWorkflowJobs(ctx context.Context, owner, repo string, runID int64) ([]*gh.WorkflowJob, error)
GetJobLogs(ctx context.Context, owner, repo string, jobID int64) (string, error)
GetWorkflowInputs(ctx context.Context, owner, repo, path, ref string) ([]WorkflowInput, error)
}
ActionReader provides read-only access to GitHub Actions workflow runs and jobs.
type ActionStatus ¶
type ActionStatus string
ActionStatus represents the conclusion or status of a GitHub Actions workflow run.
const ( ActionStatusSuccess ActionStatus = "success" ActionStatusFailure ActionStatus = "failure" ActionStatusInProgress ActionStatus = "in_progress" ActionStatusQueued ActionStatus = "queued" ActionStatusCancelled ActionStatus = "cancelled" )
type ActionWriter ¶
type ActionWriter interface {
RerunFailedJobs(ctx context.Context, owner, repo string, runID int64) error
RerunWorkflow(ctx context.Context, owner, repo string, runID int64) error
CancelWorkflowRun(ctx context.Context, owner, repo string, runID int64) error
DispatchWorkflow(ctx context.Context, owner, repo string, workflowID int64, ref string, inputs map[string]any) error
}
ActionWriter provides mutation operations on GitHub Actions workflow runs.
type Client ¶
type Client interface {
IssueReader
IssueWriter
PRReader
PRWriter
ActionReader
ActionWriter
ReleaseReader
NotificationReader
RepoInfo(ctx context.Context, owner, repo string) (*gh.Repository, error)
CurrentUser(ctx context.Context) (*gh.User, error)
}
Client composes all GitHub operation interfaces into a single client.
type IssueFilter ¶
type IssueFilter string
IssueFilter defines filter options for listing issues.
const ( IssueFilterAll IssueFilter = "all" IssueFilterAssigned IssueFilter = "assigned" IssueFilterMentioned IssueFilter = "mentioned" IssueFilterCreated IssueFilter = "created" )
type IssueReader ¶
type IssueReader interface {
ListIssues(ctx context.Context, owner, repo string, opts *gh.IssueListByRepoOptions) ([]*gh.Issue, error)
ListIssuesPage(ctx context.Context, owner, repo string, opts *gh.IssueListByRepoOptions) ([]*gh.Issue, PageResult, error)
GetIssue(ctx context.Context, owner, repo string, number int) (*gh.Issue, error)
GetIssueComments(ctx context.Context, owner, repo string, number int) ([]*gh.IssueComment, error)
}
IssueReader provides read-only access to GitHub issues.
type IssueWriter ¶
type IssueWriter interface {
CreateIssue(ctx context.Context, owner, repo string, req *gh.IssueRequest) (*gh.Issue, error)
EditIssue(ctx context.Context, owner, repo string, number int, req *gh.IssueRequest) error
CommentOnIssue(ctx context.Context, owner, repo string, number int, body string) error
CloseIssue(ctx context.Context, owner, repo string, number int) error
ReopenIssue(ctx context.Context, owner, repo string, number int) error
}
IssueWriter provides mutation operations on GitHub issues.
type NotificationReader ¶
type NotificationReader interface {
ListNotifications(ctx context.Context, opts *gh.NotificationListOptions) ([]*gh.Notification, error)
MarkRead(ctx context.Context, threadID string) error
}
NotificationReader provides access to GitHub notifications.
type PRReader ¶
type PRReader interface {
ListPRs(ctx context.Context, owner, repo string, opts *gh.PullRequestListOptions) ([]*gh.PullRequest, error)
ListPRsPage(ctx context.Context, owner, repo string, opts *gh.PullRequestListOptions) ([]*gh.PullRequest, PageResult, error)
GetPR(ctx context.Context, owner, repo string, number int) (*gh.PullRequest, error)
GetPRFiles(ctx context.Context, owner, repo string, number int) ([]*gh.CommitFile, error)
GetPRComments(ctx context.Context, owner, repo string, number int) ([]*gh.PullRequestComment, error)
GetPRReviews(ctx context.Context, owner, repo string, number int) ([]*gh.PullRequestReview, error)
GetPRDiff(ctx context.Context, owner, repo string, number int) (string, error)
GetPRCommits(ctx context.Context, owner, repo string, number int) ([]*gh.RepositoryCommit, error)
}
PRReader provides read-only access to GitHub pull requests.
type PRWriter ¶
type PRWriter interface {
CreatePR(ctx context.Context, owner, repo string, req *gh.NewPullRequest) (*gh.PullRequest, error)
MergePR(ctx context.Context, owner, repo string, number int, msg string, opts *gh.PullRequestOptions) error
DeleteBranch(ctx context.Context, owner, repo, branch string) error
CommentOnPR(ctx context.Context, owner, repo string, number int, body string, path string, line int) error
SubmitReview(ctx context.Context, owner, repo string, number int, review *gh.PullRequestReviewRequest) error
RequestReviewers(ctx context.Context, owner, repo string, number int, reviewers []string) error
}
PRWriter provides mutation operations on GitHub pull requests.
type PageResult ¶ added in v0.1.0
type PageResult struct {
NextPage int // 0 means no more pages
TotalCount int // total count if available from API (-1 if unknown)
}
PageResult holds pagination metadata for paged list operations.
type ReleaseReader ¶
type ReleaseReader interface {
ListReleases(ctx context.Context, owner, repo string, opts *gh.ListOptions) ([]*gh.RepositoryRelease, error)
ListReleasesPage(ctx context.Context, owner, repo string, opts *gh.ListOptions) ([]*gh.RepositoryRelease, PageResult, error)
GetRelease(ctx context.Context, owner, repo string, id int64) (*gh.RepositoryRelease, error)
GetReleaseByTag(ctx context.Context, owner, repo, tag string) (*gh.RepositoryRelease, error)
}
ReleaseReader provides read-only access to GitHub releases.