Documentation
¶
Index ¶
- Constants
- func GetOrgProjectFromRepos(repos string) (owner string, project string)
- func NewGithub(ctx context.Context, httpcli *http.Client, repos string) (cli libart.Client, err error)
- func NewGithubWithTokenOAuth(ctx context.Context, repos string, oauth2client *http.Client) (cli libart.Client, err error)
Constants ¶
const ( ErrorParamEmpty liberr.CodeError = iota + libart.MinArtifactGithub ErrorURLParse ErrorClientInit ErrorGithubList ErrorGithubGetRelease ErrorGithubNotFound ErrorGithubRequestNew ErrorGithubRequestRun ErrorGithubResponse ErrorGithubIOCopy ErrorDestinationStat ErrorDestinationSize )
Variables ¶
This section is empty.
Functions ¶
func GetOrgProjectFromRepos ¶ added in v1.19.0
GetOrgProjectFromRepos parses a GitHub repository path and extracts the owner and project name. The repos parameter should be in the format "owner/project" (with or without leading/trailing slashes).
Example:
owner, project := GetOrgProjectFromRepos("google/go-github")
// Returns: owner="google", project="go-github"
func NewGithub ¶
func NewGithub(ctx context.Context, httpcli *http.Client, repos string) (cli libart.Client, err error)
NewGithub returns a new Github client.
The context is used to set the http client. The httpcli parameter is used to set the http client. The repos parameter is used to get the owner and project from the repository path.
The returned client can be used to list releases and download artifacts.
func NewGithubWithTokenOAuth ¶
func NewGithubWithTokenOAuth(ctx context.Context, repos string, oauth2client *http.Client) (cli libart.Client, err error)
NewGithubWithTokenOAuth returns a new Github client with OAuth2 authentication.
The context is used to set the http client. The repos parameter is used to get the owner and project from the repository path. The oauth2client parameter is used to set the OAuth2 authenticated http client.
The returned client can be used to list releases and download artifacts.
Types ¶
This section is empty.