Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrorUnableToListAllResult = errors.New("unable to list all results")
Functions ¶
This section is empty.
Types ¶
type Searcher ¶
type Searcher struct {
// contains filtered or unexported fields
}
func NewSearcher ¶
func (*Searcher) ReposByStars ¶
func (re *Searcher) ReposByStars(baseQuery string, minStars, overlap int, emitter func(string)) error
ReposByStars will call emitter once for each repository returned when searching for baseQuery with at least minStars, order from the most stars, to the least.
The emitter function is called with the repository's Url.
The algorithm works to overcome the approx 1000 repository limit returned by a single search across 10 pages by: - Ordering GitHub's repositories from most stars to least. - Iterating through all the repositories returned by each query. - Getting the number of stars for the last repository returned. - Using this star value, plus an overlap, to be the maximum star limit.
The algorithm fails if the last star value plus overlap has the same or larger value as the previous iteration.