Documentation
¶
Index ¶
- type CheckService
- type Comment
- type Issue
- type IssueFilters
- type IssueService
- type IssueUpdate
- type Label
- type LabelService
- type MergeMethod
- type MergeResult
- type Milestone
- type MilestoneService
- type MilestoneUpdate
- type PRFilters
- type Platform
- type PullRequest
- type PullRequestService
- type RepoInfo
- type RepositoryService
- type ReviewEvent
- type Run
- type RunFilters
- type Runner
- type RunnerService
- type WorkflowService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckService ¶
type CheckService interface {
// GetCombinedStatus returns the combined CI status for a ref (branch or SHA).
// Returns "success", "failure", "pending", or "error".
GetCombinedStatus(ctx context.Context, ref string) (string, error)
// RerunFailedChecks re-runs failed check suites for a ref.
RerunFailedChecks(ctx context.Context, ref string) error
}
type IssueFilters ¶
type IssueService ¶
type IssueService interface {
Create(ctx context.Context, title, body string, labels []string, milestone *int) (*Issue, error)
Get(ctx context.Context, number int) (*Issue, error)
List(ctx context.Context, filters IssueFilters) ([]*Issue, error)
Update(ctx context.Context, number int, changes IssueUpdate) (*Issue, error)
AddLabels(ctx context.Context, number int, labels []string) error
RemoveLabels(ctx context.Context, number int, labels []string) error
AddComment(ctx context.Context, number int, body string) error
DeleteComment(ctx context.Context, commentID int64) error
ListComments(ctx context.Context, number int) ([]*Comment, error)
CreateCommentReaction(ctx context.Context, commentID int64, reaction string) error
}
type IssueUpdate ¶
type LabelService ¶
type MergeMethod ¶
type MergeMethod string
const ( MergeMethodMerge MergeMethod = "merge" MergeMethodSquash MergeMethod = "squash" MergeMethodRebase MergeMethod = "rebase" )
type MergeResult ¶
type MilestoneService ¶
type MilestoneService interface {
Create(ctx context.Context, title, description string, dueDate *time.Time) (*Milestone, error)
Get(ctx context.Context, number int) (*Milestone, error)
List(ctx context.Context) ([]*Milestone, error)
Update(ctx context.Context, number int, changes MilestoneUpdate) (*Milestone, error)
}
type MilestoneUpdate ¶
type Platform ¶
type Platform interface {
Issues() IssueService
PullRequests() PullRequestService
Workflows() WorkflowService
Labels() LabelService
Milestones() MilestoneService
Runners() RunnerService
Repository() RepositoryService
Checks() CheckService
}
Platform abstracts all interactions with the hosting platform (GitHub, GitLab, etc.).
type PullRequest ¶
type PullRequestService ¶
type PullRequestService interface {
Create(ctx context.Context, title, body, head, base string) (*PullRequest, error)
Get(ctx context.Context, number int) (*PullRequest, error)
List(ctx context.Context, filters PRFilters) ([]*PullRequest, error)
Update(ctx context.Context, number int, title, body *string) (*PullRequest, error)
Merge(ctx context.Context, number int, method MergeMethod) (*MergeResult, error)
UpdateBranch(ctx context.Context, number int) error
CreateReview(ctx context.Context, number int, body string, event ReviewEvent) error
AddComment(ctx context.Context, number int, body string) error
GetDiff(ctx context.Context, number int) (string, error)
Close(ctx context.Context, number int) error
}
type RepositoryService ¶
type RepositoryService interface {
GetInfo(ctx context.Context) (*RepoInfo, error)
GetDefaultBranch(ctx context.Context) (string, error)
CreateBranch(ctx context.Context, name, fromSHA string) error
DeleteBranch(ctx context.Context, name string) error
GetBranchSHA(ctx context.Context, name string) (string, error)
}
type ReviewEvent ¶
type ReviewEvent string
const ( ReviewApprove ReviewEvent = "APPROVE" ReviewRequestChanges ReviewEvent = "REQUEST_CHANGES" ReviewComment ReviewEvent = "COMMENT" )
type RunFilters ¶
type RunnerService ¶
type WorkflowService ¶
type WorkflowService interface {
GetWorkflow(ctx context.Context, filename string) (workflowID int64, err error)
Dispatch(ctx context.Context, workflowFile, ref string, inputs map[string]string) (*Run, error)
GetRun(ctx context.Context, runID int64) (*Run, error)
ListRuns(ctx context.Context, filters RunFilters) ([]*Run, error)
CancelRun(ctx context.Context, runID int64) error
}
Click to show internal directories.
Click to hide internal directories.