module

GithubMirror

Constants

GITHUB_API = "https://api.github.com"
VERSION = "0.1.0"

Instance methods

enumerate_repos(token : String) : Array(Repo)

Enumerate every repo the token can see, following pagination to exhaustion Any API failure is fatal: abort rather than risk acting on a partial or empty list (can't list repos must never be read as not having any repos)

Source
env_bool(name : String, default : Bool) : Bool
Source
git_auth_env(token : String) : Hash(String, String)
Source
load_state(path : Path) : MirrorState
Source
main
Source
now_iso
Source
read_token
Source
run_git(args : Array(String), env : Hash(String, String), timeout : Int32 | Nil) : Tuple(Bool, String)

Run a git subprocess with the given environment. Returns {success, error}.

TODO: cancel the timeout timer on completion before adding the concurrent clone pool. As written, a fast-finishing git leaves a fiber sleeping the full timeout; harmless when sequential, but N sleepers accumulate under concurrency. Replace with a Channel/select-based cancellation then.

Source
select_repos(repos : Array(Repo), include_forks : Bool, include_archived : Bool) : Array(Repo)
Source
sync_repo(repo : Repo, mirror_root : Path, env : Hash(String, String), timeout : Int32 | Nil, fetch_lfs : Bool) : Bool
Source