Documentation
¶
Overview ¶
Package githubapi provides shared helpers for authenticated GitHub API requests and on-disk JSON caching. Both the EIP and consensus-specs fetchers use these helpers to build requests with optional bearer-token auth from GITHUB_TOKEN or GH_TOKEN environment variables, and to read and write their cache files.
Index ¶
Constants ¶
const APIBase = "https://api.github.com"
APIBase is the root URL for the GitHub REST API.
Variables ¶
This section is empty.
Functions ¶
func NewRequest ¶
NewRequest creates an HTTP GET request for the GitHub API. If GITHUB_TOKEN or GH_TOKEN is set, a Bearer authorization header is added automatically.
func ReadCache ¶ added in v0.30.0
ReadCache reads and JSON-decodes a cache file into a value of type T.
func Token ¶
func Token() string
Token returns the first non-empty value from GITHUB_TOKEN or GH_TOKEN.
func WriteCache ¶ added in v0.30.0
WriteCache JSON-encodes a cache value and writes it to a file.
Types ¶
This section is empty.