Documentation
¶
Overview ¶
Package github lists and mirrors repositories from GitHub.com over its REST API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrMissingRepoScope = errors.New(`github token is missing the "repo" scope: private repositories would not be listed`)
ErrMissingRepoScope means a classic personal access token's granted scopes don't include "repo". GitHub doesn't error on that -- /user/repos still returns 200 with just the public repositories -- so left unchecked this is a backup that silently never carried anything private.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client lists and mirrors repositories from GitHub.com.
func New ¶
New builds a Client. An empty base uses GitHub.com's own API host; a test points it at a recorded fixture server instead.
func (*Client) ListRepos ¶
ListRepos implements backup.Lister by paging through GET /user/repos for the authenticated token. That endpoint has no server-side archived filter, unlike Forgejo's search or GitLab's projects endpoint, so every repo is fetched once and filtered by state locally. GitHub's repo object carries no "is this repo empty" field either; size is reported in kilobytes and a repo with no commits pushed yet reports 0, which is what Empty is derived from.