github

package
v1.24.10 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: Apache-2.0 Imports: 9 Imported by: ? 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

This section is empty.

Functions

func GetGitHubHeaders added in v1.24.8

func GetGitHubHeaders(requestURL string) map[string]string

GetGitHubHeaders returns headers to be used in GitHub REST API requests if the URL is for GitHub. See https://docs.github.com/en/rest/authentication/authenticating-to-the-rest-api

func GetGitHubRelease added in v1.24.8

func GetGitHubRelease(owner, repo, requestedVersion string) (tarballURL, downloadedRelease string, err error)

GetGitHubRelease gets the tarball URL and version for a GitHub repository release

func GetGitHubToken added in v1.24.8

func GetGitHubToken() (string, string)

GetGitHubToken returns the GitHub token from the environment and the name of the variable it was found in.

func HasGitHubToken added in v1.24.9

func HasGitHubToken() bool

HasGitHubToken returns true if a GitHub token is set in the environment.

func HasInvalidGitHubToken added in v1.24.9

func HasInvalidGitHubToken(response interface{}) error

HasInvalidGitHubToken checks if the response indicates an invalid GitHub token. This is possible if we get 401 or 404 response.

Types

type Client added in v1.24.8

type Client = github.Client

func GetGitHubClient added in v1.24.8

func GetGitHubClient(withAuth bool) (context.Context, *Client)

GetGitHubClient returns a singleton GitHub client and context, initializing it if necessary.

type ListOptions added in v1.24.8

type ListOptions = github.ListOptions

type Repository added in v1.24.8

type Repository = github.Repository

type SearchOptions added in v1.24.8

type SearchOptions = github.SearchOptions

Jump to

Keyboard shortcuts

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