Documentation ¶
Index ¶
- func Comment(id int, login string, createdAt time.Time, body string) *github.IssueComment
- func Commit(sha string, t int64) *github.Commit
- func Commits(num int, time int64) []*github.RepositoryCommit
- func Events(labels []LabelTime) []*github.IssueEvent
- func InitServer(t *testing.T, issue *github.Issue, pr *github.PullRequest, ...) (*github.Client, *httptest.Server, *http.ServeMux)
- func Issue(user string, number int, labels []string, isPR bool) *github.Issue
- func IssueComment(id int, body string, user string, createAt int64) *github.IssueComment
- func MultiIssueEvents(issueToEvents map[int][]LabelTime, eventName string) (out []*github.IssueEvent)
- func PullRequest(user string, merged, mergeDetermined, mergeable bool) *github.PullRequest
- func ServeIssue(t *testing.T, mux *http.ServeMux, issue *github.Issue)
- func Status(sha string, success []string, fail []string, pending []string, ...) *github.CombinedStatus
- func StringsToLabels(labelNames []string) []github.Label
- type LabelTime
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Commits ¶
func Commits(num int, time int64) []*github.RepositoryCommit
Commits returns an array of github.RepositoryCommits. The first commit will have happened at time `time`, the next commit `time + 1`, etc
func Events ¶
func Events(labels []LabelTime) []*github.IssueEvent
Events returns a slice of github.IssueEvent where the specified labels were applied at the specified times
func InitServer ¶
func InitServer(t *testing.T, issue *github.Issue, pr *github.PullRequest, events []*github.IssueEvent, commits []*github.RepositoryCommit, status *github.CombinedStatus, masterCommit *github.RepositoryCommit, files []*github.CommitFile) (*github.Client, *httptest.Server, *http.ServeMux)
InitServer will return a github.Client which will talk to httptest.Server, to retrieve information from the http.ServeMux. If an issue, pr, events, or commits are supplied it will repond with those on o/r/
func IssueComment ¶
IssueComment returns a filled out github.IssueComment which happened at time.Unix(t, 0).
func MultiIssueEvents ¶
func MultiIssueEvents(issueToEvents map[int][]LabelTime, eventName string) (out []*github.IssueEvent)
MultiIssueEvents packages up events for when you have multiple issues in the test server.
func PullRequest ¶
func PullRequest(user string, merged, mergeDetermined, mergeable bool) *github.PullRequest
PullRequest returns a filled out github.PullRequest
func ServeIssue ¶
ServeIssue is a helper to load additional issues into the test server
func Status ¶
func Status(sha string, success []string, fail []string, pending []string, errored []string) *github.CombinedStatus
Status returns a github.CombinedStatus
func StringsToLabels ¶
StringsToLabels converts a slice of label names to a slice of github.Label instances in non-determinastic order.