Documentation
¶
Index ¶
- type Comment
- type Commit
- type CommitState
- type CommitStatus
- type File
- type Issue
- func (i *Issue) Author(u *User) *Issue
- func (i *Issue) Comments(comments []*Comment) *Issue
- func (i *Issue) CreatedAt(t time.Time) *Issue
- func (i *Issue) Number(v int) *Issue
- func (i *Issue) State(v IssueState) *Issue
- func (i *Issue) Title(v string) *Issue
- func (i *Issue) UpdatedAt(t time.Time) *Issue
- type IssueState
- type Mock
- func (m *Mock) GitHTTPHandler() http.Handler
- func (m *Mock) LookupRepository(name string) *Repository
- func (m *Mock) RegisterHandler(mux *http.ServeMux)
- func (m *Mock) Repositories() []*Repository
- func (m *Mock) Repository(name string) *Repository
- func (m *Mock) Team(slug string) *Team
- func (m *Mock) Transport() http.RoundTripper
- func (m *Mock) User(login string) *User
- type PullRequest
- func (pr *PullRequest) Author(u *User) *PullRequest
- func (pr *PullRequest) Base(ref string) *PullRequest
- func (pr *PullRequest) Body(v string) *PullRequest
- func (pr *PullRequest) Comments(comments ...*PullRequestComment) *PullRequest
- func (pr *PullRequest) CreatedAt(t time.Time) *PullRequest
- func (pr *PullRequest) GetNumber() int
- func (pr *PullRequest) GetState() string
- func (pr *PullRequest) GetTitle() string
- func (pr *PullRequest) Head(repo *Repository, ref, sha string) *PullRequest
- func (pr *PullRequest) Mergeable() *PullRequest
- func (pr *PullRequest) Merged() *PullRequest
- func (pr *PullRequest) Number(v int) *PullRequest
- func (pr *PullRequest) Reviews(reviews ...*Review) *PullRequest
- func (pr *PullRequest) State(v PullRequestState) *PullRequest
- func (pr *PullRequest) Title(v string) *PullRequest
- func (pr *PullRequest) UpdatedAt(t time.Time) *PullRequest
- type PullRequestComment
- type PullRequestState
- type Repository
- func (r *Repository) AssertPullRequest(t *testing.T, number int) *PullRequest
- func (r *Repository) BuildPullRequestEvent(action string, pr *PullRequest, sender *User) *github.PullRequestEvent
- func (r *Repository) BuildPushEvent(ref string, commit *Commit, sender *User) *github.PushEvent
- func (r *Repository) Commits(commits ...*Commit) error
- func (r *Repository) DefaultBranch(v string)
- func (r *Repository) FullName() string
- func (r *Repository) GetCommit(sha string) *Commit
- func (r *Repository) GetCommits() []*Commit
- func (r *Repository) GetIssue(num int) *Issue
- func (r *Repository) GetIssues() []*Issue
- func (r *Repository) GetPullRequest(num int) *PullRequest
- func (r *Repository) GetPullRequests() []*PullRequest
- func (r *Repository) Issues(issues ...*Issue)
- func (r *Repository) NextIndex() int
- func (r *Repository) PullRequests(pullRequests ...*PullRequest)
- func (r *Repository) SendWebhook(ctx context.Context, event string, payload any) []*WebhookDelivery
- func (r *Repository) Tags(tags ...*Tag)
- func (r *Repository) Webhook(w *Webhook) *Webhook
- func (r *Repository) Webhooks() []*Webhook
- type Review
- type ReviewState
- type Tag
- type Team
- type User
- type Webhook
- type WebhookDelivery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comment ¶
type Comment struct {
// contains filtered or unexported fields
}
func NewComment ¶
func NewComment() *Comment
type Commit ¶
type Commit struct {
// contains filtered or unexported fields
}
func (*Commit) Statuses ¶
func (c *Commit) Statuses(statuses ...*CommitStatus) *Commit
type CommitState ¶
type CommitState string
const ( CommitStatePending CommitState = "pending" CommitStateSuccess CommitState = "success" CommitStateFailure CommitState = "failure" CommitStateError CommitState = "error" )
type CommitStatus ¶
type CommitStatus struct {
State CommitState
Description string
}
type Issue ¶
type Issue struct {
// contains filtered or unexported fields
}
func (*Issue) State ¶
func (i *Issue) State(v IssueState) *Issue
type IssueState ¶
type IssueState string
const ( IssueStateOpen IssueState = "open" IssueStateClosed IssueState = "closed" )
type Mock ¶
type Mock struct {
Logger *slog.Logger
Scheme string
Host string
Port int
GitHubURL string
// contains filtered or unexported fields
}
func (*Mock) GitHTTPHandler ¶
GitHTTPHandler returns an http.Handler that serves repositories over the git smart HTTP protocol. It supports cloning and fetching (git-upload-pack). The handler is intended to be served on a different port than the GitHub API.
func (*Mock) LookupRepository ¶
func (m *Mock) LookupRepository(name string) *Repository
func (*Mock) RegisterHandler ¶
func (*Mock) Repositories ¶
func (m *Mock) Repositories() []*Repository
func (*Mock) Repository ¶
func (m *Mock) Repository(name string) *Repository
func (*Mock) Transport ¶
func (m *Mock) Transport() http.RoundTripper
type PullRequest ¶
type PullRequest struct {
// contains filtered or unexported fields
}
func NewPullRequest ¶
func NewPullRequest() *PullRequest
func (*PullRequest) Author ¶
func (pr *PullRequest) Author(u *User) *PullRequest
func (*PullRequest) Base ¶
func (pr *PullRequest) Base(ref string) *PullRequest
func (*PullRequest) Body ¶
func (pr *PullRequest) Body(v string) *PullRequest
func (*PullRequest) Comments ¶
func (pr *PullRequest) Comments(comments ...*PullRequestComment) *PullRequest
func (*PullRequest) CreatedAt ¶
func (pr *PullRequest) CreatedAt(t time.Time) *PullRequest
func (*PullRequest) GetNumber ¶
func (pr *PullRequest) GetNumber() int
func (*PullRequest) GetState ¶
func (pr *PullRequest) GetState() string
func (*PullRequest) GetTitle ¶
func (pr *PullRequest) GetTitle() string
func (*PullRequest) Head ¶
func (pr *PullRequest) Head(repo *Repository, ref, sha string) *PullRequest
func (*PullRequest) Mergeable ¶
func (pr *PullRequest) Mergeable() *PullRequest
func (*PullRequest) Merged ¶
func (pr *PullRequest) Merged() *PullRequest
func (*PullRequest) Number ¶
func (pr *PullRequest) Number(v int) *PullRequest
func (*PullRequest) Reviews ¶
func (pr *PullRequest) Reviews(reviews ...*Review) *PullRequest
func (*PullRequest) State ¶
func (pr *PullRequest) State(v PullRequestState) *PullRequest
func (*PullRequest) Title ¶
func (pr *PullRequest) Title(v string) *PullRequest
func (*PullRequest) UpdatedAt ¶
func (pr *PullRequest) UpdatedAt(t time.Time) *PullRequest
type PullRequestComment ¶
type PullRequestComment struct {
// contains filtered or unexported fields
}
func NewPullRequestComment ¶
func NewPullRequestComment() *PullRequestComment
func (*PullRequestComment) Author ¶
func (c *PullRequestComment) Author(u *User) *PullRequestComment
func (*PullRequestComment) Body ¶
func (c *PullRequestComment) Body(v string) *PullRequestComment
type PullRequestState ¶
type PullRequestState string
const ( PullRequestStateOpen PullRequestState = "open" PullRequestStateClosed PullRequestState = "closed" )
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func (*Repository) AssertPullRequest ¶
func (r *Repository) AssertPullRequest(t *testing.T, number int) *PullRequest
func (*Repository) BuildPullRequestEvent ¶
func (r *Repository) BuildPullRequestEvent(action string, pr *PullRequest, sender *User) *github.PullRequestEvent
func (*Repository) BuildPushEvent ¶
func (*Repository) Commits ¶
func (r *Repository) Commits(commits ...*Commit) error
func (*Repository) DefaultBranch ¶
func (r *Repository) DefaultBranch(v string)
func (*Repository) FullName ¶
func (r *Repository) FullName() string
func (*Repository) GetCommit ¶
func (r *Repository) GetCommit(sha string) *Commit
func (*Repository) GetCommits ¶
func (r *Repository) GetCommits() []*Commit
func (*Repository) GetIssue ¶
func (r *Repository) GetIssue(num int) *Issue
func (*Repository) GetIssues ¶
func (r *Repository) GetIssues() []*Issue
func (*Repository) GetPullRequest ¶
func (r *Repository) GetPullRequest(num int) *PullRequest
func (*Repository) GetPullRequests ¶
func (r *Repository) GetPullRequests() []*PullRequest
func (*Repository) Issues ¶
func (r *Repository) Issues(issues ...*Issue)
func (*Repository) NextIndex ¶
func (r *Repository) NextIndex() int
func (*Repository) PullRequests ¶
func (r *Repository) PullRequests(pullRequests ...*PullRequest)
func (*Repository) SendWebhook ¶
func (r *Repository) SendWebhook(ctx context.Context, event string, payload any) []*WebhookDelivery
func (*Repository) Tags ¶
func (r *Repository) Tags(tags ...*Tag)
func (*Repository) Webhook ¶
func (r *Repository) Webhook(w *Webhook) *Webhook
func (*Repository) Webhooks ¶
func (r *Repository) Webhooks() []*Webhook
type Review ¶
type Review struct {
// contains filtered or unexported fields
}
func (*Review) State ¶
func (r *Review) State(v ReviewState) *Review
type ReviewState ¶
type ReviewState string
const ( ReviewStateChangesRequested ReviewState = "CHANGES_REQUESTED" ReviewStateCommented ReviewState = "COMMENTED" ReviewStateApproved ReviewState = "APPROVED" )
type Webhook ¶
type Webhook struct {
// contains filtered or unexported fields
}
func NewWebhook ¶
func NewWebhook() *Webhook
type WebhookDelivery ¶
Click to show internal directories.
Click to hide internal directories.