github

package
v1.19.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
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

func GetOrgProjectFromRepos(repos string) (owner string, project string)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL