goreapers / gograveyard

The Go project undertaker: check go.mod dependency's health
MIT License
1 stars 0 forks source link

github: create initial helper api client #6

Open powersj opened 1 year ago

powersj commented 1 year ago

Create a GitHub API client that takes a token that will allow us to gather statistics about a specific repo.

APIs

The necessary APIs may be one or all of the following per repo:

One of these requests may also include the stargazers_count, forks_count, and watchers_count.

Authentication

We are going to need to authenticate as a user will hit this limit pretty quickly:

Unauthenticated clients can make 60 requests per hour. 

This is taken care of via the "Authorization" header (e.g. token <my token here>):

$ curl -i -H 'Authorization: token <token>' https://api.github.com/user

Data

We will want to keep track of:

Docs

Explain how to create a personal access token in GitHub UI that has the minimum amount of access.