Documentation
¶
Overview ¶
SPDX-License-Identifier: MIT
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckRateLimit ¶
CheckRateLimit retrieves the current GitHub API rate limit status and logs it. This is useful for monitoring usage and diagnosing rate limit errors.
- ctx: The context for the API call, allows for cancellation/timeouts. - client: The initialized GitHub client for making API requests.
func NewClient ¶
NewClient initializes and returns a new GitHub API client. It configures authentication (using GITHUB_TOKEN if available) and adds an HTTP cache layer.
- ctx: The context for the client, allows for cancellation. Returns: An initialized *github.Client and an error if setup fails (e.g., cache directory creation).
func PrintRateLimit ¶
PrintRateLimit logs rate limit information extracted directly from a GitHub API Response. This function is primarily used as a fallback if retrieving the full RateLimit struct fails.
- resp: The *github.Response object from a GitHub API call.
Types ¶
type CachingTransport ¶
type CachingTransport struct {
Transport http.RoundTripper // The underlying transport, which could be the cache transport or an authenticated transport.
}
CachingTransport wraps an http.RoundTripper to potentially add custom logic, such as logging or metrics, around the transport (including the cache layer).