Documentation
¶
Index ¶
- Constants
- Variables
- func FetchCreatedTime(ctx context.Context, c *githubapi.Client, owner, name string, ...) (time.Time, error)
- func FetchIssueCommentCount(ctx context.Context, c *githubapi.Client, owner, name string, ...) (int, error)
- func FetchIssueCount(ctx context.Context, c *githubapi.Client, owner, name string, state IssueState, ...) (int, error)
- func FetchOrgCount(ctx context.Context, c *githubapi.Client, owner, name string) (int, error)
- func FetchReleaseCount(ctx context.Context, c *githubapi.Client, owner, name string, ...) (int, error)
- func FetchTotalContributors(ctx context.Context, c *githubapi.Client, owner, name string) (int, error)
- func Round(v float64, p int) float64
- func TimeDelta(a, b time.Time, u time.Duration) int
- type IssueState
Constants ¶
const ( SinceDuration time.Duration = time.Hour * 24 * 30 IssueLookback time.Duration = time.Hour * 24 * 90 * 24 // TODO: these limits should ultimately be imposed by the score generation, not here. MaxContributorLimit = 5000 MaxIssuesLimit = 5000 MaxTopContributors = 15 TooManyContributorsOrgCount = 10 TooManyCommentsFrequency = 2.0 )
const ( IssueStateAll = "all" IssueStateOpen = "open" IssueStateClosed = "closed" )
Variables ¶
var ErrorTooManyResults = errors.New("too many results")
Functions ¶
func FetchCreatedTime ¶
func FetchCreatedTime(ctx context.Context, c *githubapi.Client, owner, name string, earliestSoFar time.Time) (time.Time, error)
FetchCreatedTime returns the earliest known creation time for a given repository based on the commit history, before or equal to earliestSoFar.
Only times before earliestSoFar will be considered. If there is no time before earliestSoFar found, the value of earliestSoFar will be returned.
func FetchIssueCommentCount ¶
func FetchIssueCommentCount(ctx context.Context, c *githubapi.Client, owner, name string, lookback time.Duration) (int, error)
FetchIssueCommentCount returns the total number of comments for a given repo across all issues and pull requests, for the past lookback duration.
If the exact number if unable to be returned because there are too many results, a TooManyResultsError will be returned.
func FetchIssueCount ¶
func FetchIssueCount(ctx context.Context, c *githubapi.Client, owner, name string, state IssueState, lookback time.Duration) (int, error)
FetchIssueCount returns the total number of issues for a given repo in a given state, across the past lookback duration.
This count includes both issues and pull requests.
func FetchOrgCount ¶
FetchOrgCount returns the number of unique orgs/companies for the top MaxTopContributors of a given repository.
If there are too many contributors for the given repo, the number returned will be TooManyContributorsOrgCount.
func FetchReleaseCount ¶
func FetchTotalContributors ¶
func FetchTotalContributors(ctx context.Context, c *githubapi.Client, owner, name string) (int, error)
FetchTotalContributors returns the total number of contributors for the given repository.
Results will be capped to MaxContributorLimit.
Types ¶
type IssueState ¶
type IssueState string