gh

package
v0.0.0-...-4788987 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRateLimit             = errors.New("rate limit hit")
	ErrAssetNotFound         = errors.New("asset not found")
	ErrUnableToDownloadAsset = errors.New("unable to download asset")
	ErrUnableToReadAsset     = errors.New("unable to download asset")
	ErrFatalError            = errors.New("fatal error using github")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(token string) *Client

NewClient creates a new Github Client. If the token is not empty, it will use it as the auth token to make calls.

func (*Client) DownloadFileFromRelease

func (c *Client) DownloadFileFromRelease(
	ctx context.Context,
	owner, repo string,
	httpClient *http.Client,
	filePattern string) (*ReleaseFile, error)

type ReleaseFile

type ReleaseFile struct {
	Contents io.ReadCloser
	Info     ReleaseInfo
}

ReleaseFile represents a file in a given Github release.

type ReleaseInfo

type ReleaseInfo struct {
	// If the tag is valid, the will be non null.
	Tag *string
}

type RepoClient

type RepoClient interface {
	GetLatestRelease(ctx context.Context, owner, repo string) (*github.RepositoryRelease, *github.Response, error)
}

Jump to

Keyboard shortcuts

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