github

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnexpectedAPIResponse = errors.New("unexpected API response")
	ErrRateLimited           = errors.New("rate limit exceeded")
)

Functions

This section is empty.

Types

type GithubClient

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

func NewGithubClient

func NewGithubClient(token string) *GithubClient

NewGithubClient creates a client for the github API, if the token is empty then requests are unauthenticated.

func (*GithubClient) GetFileContents added in v0.17.0

func (c *GithubClient) GetFileContents(owner string, repo string, path string, ref string) ([]byte, bool, error)

GetFileContents fetches the contents of the file at the given path on the given ref, or the repository's default branch when it's empty. The bool is false if the file does not exist.

func (*GithubClient) LatestVersion

func (c *GithubClient) LatestVersion(owner string, repo string) (*semver.Version, error)

func (*GithubClient) VersionExists

func (c *GithubClient) VersionExists(owner string, repo string, v string) (bool, error)

Jump to

Keyboard shortcuts

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