Documentation
¶
Index ¶
- Constants
- Variables
- type Issue
- type IssuesResult
- type Label
- type License
- type PullRequest
- type Qualifiers
- type Query
- type RepositoriesResult
- type Repository
- type Searcher
- type SearcherMock
- func (mock *SearcherMock) Issues(query Query) (IssuesResult, error)
- func (mock *SearcherMock) IssuesCalls() []struct{ ... }
- func (mock *SearcherMock) Repositories(query Query) (RepositoriesResult, error)
- func (mock *SearcherMock) RepositoriesCalls() []struct{ ... }
- func (mock *SearcherMock) URL(query Query) string
- func (mock *SearcherMock) URLCalls() []struct{ ... }
- type User
Constants ¶
View Source
const ( KindRepositories = "repositories" KindIssues = "issues" )
Variables ¶
View Source
var IssueFields = []string{
"assignees",
"author",
"authorAssociation",
"body",
"closedAt",
"commentsCount",
"createdAt",
"id",
"isLocked",
"isPullRequest",
"labels",
"number",
"repository",
"state",
"title",
"updatedAt",
"url",
}
View Source
var RepositoryFields = []string{
"createdAt",
"defaultBranch",
"description",
"forksCount",
"fullName",
"hasDownloads",
"hasIssues",
"hasPages",
"hasProjects",
"hasWiki",
"homepage",
"id",
"isArchived",
"isDisabled",
"isFork",
"isPrivate",
"language",
"license",
"name",
"openIssuesCount",
"owner",
"pushedAt",
"size",
"stargazersCount",
"updatedAt",
"url",
"visibility",
"watchersCount",
}
Functions ¶
This section is empty.
Types ¶
type Issue ¶
type Issue struct { Assignees []User `json:"assignees"` Author User `json:"user"` AuthorAssociation string `json:"author_association"` Body string `json:"body"` ClosedAt time.Time `json:"closed_at"` CommentsCount int `json:"comments"` CreatedAt time.Time `json:"created_at"` ID string `json:"node_id"` Labels []Label `json:"labels"` IsLocked bool `json:"locked"` Number int `json:"number"` PullRequest PullRequest `json:"pull_request"` RepositoryURL string `json:"repository_url"` // StateInternal should not be used directly. Use State() instead. StateInternal string `json:"state"` StateReason string `json:"state_reason"` Title string `json:"title"` URL string `json:"html_url"` UpdatedAt time.Time `json:"updated_at"` }
func (Issue) ExportData ¶
func (Issue) IsPullRequest ¶
type IssuesResult ¶
type PullRequest ¶
type Qualifiers ¶
type Qualifiers struct { Archived *bool Assignee string Author string Base string Closed string Commenter string Comments string Created string Draft *bool Followers string Fork string Forks string GoodFirstIssues string Head string HelpWantedIssues string In []string Interactions string Involves string Is []string Label []string Language string License []string Mentions string Merged string Milestone string No []string Project string Pushed string Reactions string Repo []string Review string ReviewRequested string ReviewedBy string Size string Stars string State string Status string Team string TeamReviewRequested string Topic []string Topics string Type string Updated string User string }
func (Qualifiers) Map ¶
func (q Qualifiers) Map() map[string][]string
type Query ¶
type RepositoriesResult ¶
type RepositoriesResult struct { IncompleteResults bool `json:"incomplete_results"` Items []Repository `json:"items"` Total int `json:"total_count"` }
type Repository ¶
type Repository struct { CreatedAt time.Time `json:"created_at"` DefaultBranch string `json:"default_branch"` Description string `json:"description"` ForksCount int `json:"forks_count"` FullName string `json:"full_name"` HasDownloads bool `json:"has_downloads"` HasIssues bool `json:"has_issues"` HasPages bool `json:"has_pages"` HasProjects bool `json:"has_projects"` HasWiki bool `json:"has_wiki"` Homepage string `json:"homepage"` ID string `json:"node_id"` IsArchived bool `json:"archived"` IsDisabled bool `json:"disabled"` IsFork bool `json:"fork"` IsPrivate bool `json:"private"` Language string `json:"language"` License License `json:"license"` MasterBranch string `json:"master_branch"` Name string `json:"name"` OpenIssuesCount int `json:"open_issues_count"` Owner User `json:"owner"` PushedAt time.Time `json:"pushed_at"` Size int `json:"size"` StargazersCount int `json:"stargazers_count"` URL string `json:"html_url"` UpdatedAt time.Time `json:"updated_at"` Visibility string `json:"visibility"` WatchersCount int `json:"watchers_count"` }
func (Repository) ExportData ¶
func (repo Repository) ExportData(fields []string) map[string]interface{}
type Searcher ¶
type Searcher interface { Repositories(Query) (RepositoriesResult, error) Issues(Query) (IssuesResult, error) URL(Query) string }
type SearcherMock ¶
type SearcherMock struct { // IssuesFunc mocks the Issues method. IssuesFunc func(query Query) (IssuesResult, error) // RepositoriesFunc mocks the Repositories method. RepositoriesFunc func(query Query) (RepositoriesResult, error) // URLFunc mocks the URL method. URLFunc func(query Query) string // contains filtered or unexported fields }
SearcherMock is a mock implementation of Searcher.
func TestSomethingThatUsesSearcher(t *testing.T) { // make and configure a mocked Searcher mockedSearcher := &SearcherMock{ IssuesFunc: func(query Query) (IssuesResult, error) { panic("mock out the Issues method") }, RepositoriesFunc: func(query Query) (RepositoriesResult, error) { panic("mock out the Repositories method") }, URLFunc: func(query Query) string { panic("mock out the URL method") }, } // use mockedSearcher in code that requires Searcher // and then make assertions. }
func (*SearcherMock) Issues ¶
func (mock *SearcherMock) Issues(query Query) (IssuesResult, error)
Issues calls IssuesFunc.
func (*SearcherMock) IssuesCalls ¶
func (mock *SearcherMock) IssuesCalls() []struct { Query Query }
IssuesCalls gets all the calls that were made to Issues. Check the length with:
len(mockedSearcher.IssuesCalls())
func (*SearcherMock) Repositories ¶
func (mock *SearcherMock) Repositories(query Query) (RepositoriesResult, error)
Repositories calls RepositoriesFunc.
func (*SearcherMock) RepositoriesCalls ¶
func (mock *SearcherMock) RepositoriesCalls() []struct { Query Query }
RepositoriesCalls gets all the calls that were made to Repositories. Check the length with:
len(mockedSearcher.RepositoriesCalls())
func (*SearcherMock) URLCalls ¶
func (mock *SearcherMock) URLCalls() []struct { Query Query }
URLCalls gets all the calls that were made to URL. Check the length with:
len(mockedSearcher.URLCalls())
Click to show internal directories.
Click to hide internal directories.