Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrFewerResultsThanDesired = fmt.Errorf("contains fewer results than desired")
ErrFewerResultsThanDesired is used to indicate that it was not possible to fulfill the request from the user (i.e., could not find the number of results specified by the user).
This is important to specify because, for example, in research you might want to guarantee that you are analyzing _exactly_ the number of projects specifed or the search query may need to be tweaked.
Functions ¶
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend is a GitHub search backend.
type Client ¶
type Client struct { SearchService SearchService RepositoryService RepositoryService *github.Client }
Client is a minimal wrapper of the *github.Client. This makes it possible to test the GitHub search backend by mocking the GitHub client.
type RepositoryService ¶
type RepositoryService interface { // ListCommits lists the commits for a specific repository. ListCommits(context.Context, string, string, *github.CommitsListOptions) ([]*github.RepositoryCommit, *github.Response, error) }
RepositoryService is the minimal repository search interface required by the GitHub search backend. https://github.com/google/go-github/issues/113#issuecomment-454308733
type SearchService ¶
type SearchService interface { // Repositories returns the repositories for a given search query. Repositories(context.Context, string, *github.SearchOptions) (*github.RepositoriesSearchResult, *github.Response, error) Code(context.Context, string, *github.SearchOptions) (*github.CodeSearchResult, *github.Response, error) }
SearchService is the minimal search service interface required by the GitHub search backend. https://github.com/google/go-github/issues/113#issuecomment-454308733