Documentation
¶
Overview ¶
Package github provides clients for interacting with the GitHub API and downloading GitHub releases.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DownloadResult ¶
DownloadResult represents the result of downloading release assets.
type GitHubAPIClient ¶
type GitHubAPIClient struct {
// contains filtered or unexported fields
}
GitHubAPIClient represents a GitHub API client.
func NewGitHubAPIClient ¶
func NewGitHubAPIClient(opts ...GitHubAPIClientOption) *GitHubAPIClient
NewGitHubAPIClient creates a new GitHub API client with optional configuration.
func (*GitHubAPIClient) GetLatestRelease ¶
func (c *GitHubAPIClient) GetLatestRelease(ctx context.Context, repository string) (*Release, error)
GetLatestRelease fetches the latest release for a given repository. The repository should be in the format "owner/repo".
func (*GitHubAPIClient) GetLatestReleaseTag ¶
func (c *GitHubAPIClient) GetLatestReleaseTag(ctx context.Context, repository string) (string, error)
GetLatestReleaseTag is a convenience method that returns just the tag name of the latest release for a repository.
type GitHubAPIClientOption ¶
type GitHubAPIClientOption func(*GitHubAPIClient)
GitHubAPIClientOption is a function that configures a GitHubAPIClient.
func WithBaseURL ¶
func WithBaseURL(baseURL string) GitHubAPIClientOption
WithBaseURL sets the base URL for the GitHub API.
func WithHTTPClient ¶
func WithHTTPClient(httpClient *http.Client) GitHubAPIClientOption
WithHTTPClient sets the HTTP client for the GitHub client.
type GitHubReleasesDownloadClient ¶
type GitHubReleasesDownloadClient struct {
// contains filtered or unexported fields
}
GitHubReleasesDownloadClient represents a client for downloading GitHub release assets.
func NewGitHubReleasesDownloadClient ¶
func NewGitHubReleasesDownloadClient(opts ...GitHubReleasesDownloadClientOption) *GitHubReleasesDownloadClient
NewGitHubReleasesDownloadClient creates a new GitHub releases download client.
func (*GitHubReleasesDownloadClient) DownloadReleaseAssets ¶
func (c *GitHubReleasesDownloadClient) DownloadReleaseAssets( ctx context.Context, assets *ReleaseAssets, ) (*DownloadResult, error)
DownloadReleaseAssets downloads the specified release assets from a GitHub repository. It supports downloading from either full URLs (when repository contains "://") or from GitHub releases using the standard GitHub releases URL format.
type GitHubReleasesDownloadClientOption ¶
type GitHubReleasesDownloadClientOption func(*GitHubReleasesDownloadClient)
GitHubReleasesDownloadClientOption is a function that configures a GitHubReleasesDownloadClient.
func WithLogger ¶
func WithLogger(logger log.Logger) GitHubReleasesDownloadClientOption
WithLogger sets the logger for the download client.