Documentation ¶
Index ¶
- func Clear(c *Context) error
- func QueryAll(c *Context) error
- func QueryContributions(c *Context, sg []*Stargazer, rs map[string]*Repo) error
- func QueryFollowers(c *Context, sg []*Stargazer) error
- func QueryStarred(c *Context, sg []*Stargazer, rs map[string]*Repo) error
- func QueryStatistics(c *Context, r *Repo, authors map[string]struct{}) error
- func QuerySubscribed(c *Context, sg []*Stargazer, rs map[string]*Repo) error
- func QueryUserInfo(c *Context, sg []*Stargazer) error
- func SaveState(c *Context, sg []*Stargazer, rs map[string]*Repo) error
- type Context
- type Contribution
- type Contributor
- type Repo
- type Stargazer
- type User
- type Week
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func QueryAll ¶
QueryAll recursively descends into GitHub API endpoints, starting with the list of stargazers for the repo.
func QueryContributions ¶
QueryContributions queries all contributions to subscribed repos for each stargazer.
func QueryFollowers ¶
QueryFollowers queries each stargazers list of followers.
func QueryStarred ¶
QueryStarred queries all starred repos for each stargazer.
func QueryStatistics ¶
QueryStatistics queries contributor stats for the specified repo.
func QuerySubscribed ¶
QuerySubscribed queries all subscribed repos for each stargazer.
func QueryUserInfo ¶
QueryUserInfo queries user info for each stargazer.
Types ¶
type Context ¶
type Context struct { Repo string // Repository (:owner/:repo) Token string // Access token CacheDir string // Cache directory // contains filtered or unexported fields }
Context holds config information used to query GitHub.
type Contribution ¶
type Contributor ¶
type Repo ¶
type Repo struct { ID int `json:"id"` Name string `json:"name"` FullName string `json:"full_name"` Private bool `json:"private"` HtmlURL string `json:"html_url"` Fork bool `json:"fork"` URL string `json:"url"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` PushedAt string `json:"pushed_at"` Homepage string `json:"homepage"` Size int `json:"size"` StargazersCount int `json:"stargazers_count"` WatchersCount int `json:"watchers_count"` Language string `json:"language"` HasIssues bool `json:"has_issues"` HasDownloads bool `json:"has_downloads"` HasWiki bool `json:"has_wiki"` HasPages bool `json:"has_pages"` ForksCount int `json:"forks_count"` Forks int `json:"forks"` OpenIssues int `json:"open_issues"` Watchers int `json:"watchers"` DefaultBranch string `json:"default_branch"` // Contributions map from user login to contributor statistics. Statistics map[string]*Contribution `json:"statistics"` }
type Stargazer ¶
type Stargazer struct { User `json:"user"` StarredAt string `json:"starred_at"` Followers []*User `json:"follower_list"` Starred []string `json:"starred"` // Slice of repos by full name Subscribed []string `json:"subscribed"` // Slice of repos by full name // Contributions to subscribed repos (by repo FullName). Contributions map[string]*Contribution `json:"contributions"` }
Stargazer holds all information and further query URLs for a stargazer.
func QueryStargazers ¶
QueryStargazers queries the repo's stargazers API endpoint. Returns the complete slice of stargazers.
type User ¶
type User struct { Login string `json:"login"` ID int `json:"id"` AvatarURL string `json:"avatar_url"` GravatarID string `json:"gravatar_id"` URL string `json:"url"` HtmlURL string `json:"html_url"` FollowersURL string `json:"followers_url"` FollowingURL string `json:"following_url"` StarredURL string `json:"starred_url"` SubscriptionsURL string `json:"subscriptions_url"` Type string `json:"type"` SiteAdmin bool `json:"site_admin"` Name string `json:"name"` Company string `json:"company"` Blog string `json:"blog"` Location string `json:"location"` Email string `json:"email"` Hireable bool `json:"hireable"` Bio string `json:"bio"` PublicRepos int `json:"public_repos"` PublicGists int `json:"public_gists"` Followers int `json:"followers"` Following int `json:"following"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` }