Documentation
¶
Overview ¶
Package github provides a thin REST client for the GitHub API, scoped to the endpoints needed to discover the latest versions of GitHub Actions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to the GitHub REST API.
func NewClient ¶
NewClient builds a Client. If no token is supplied via WithToken, it falls back to the GITHUB_TOKEN environment variable, which raises the rate limit from 60 to 5000 requests per hour.
func (*Client) LatestRelease ¶
LatestRelease returns the latest published, non-draft release.
type NotFoundError ¶
type NotFoundError struct {
Resource string
}
NotFoundError is returned when the GitHub API responds with 404.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
type Option ¶
type Option func(*Client)
Option configures a Client.
func WithBaseURL ¶
WithBaseURL overrides the API base URL (used in tests).
func WithHTTPClient ¶
WithHTTPClient overrides the underlying HTTP client.
type RateLimitError ¶
type RateLimitError struct {
Authenticated bool
}
RateLimitError is returned when the GitHub API rate limit is exhausted.
func (*RateLimitError) Error ¶
func (e *RateLimitError) Error() string