gh

package
v0.0.0-...-df82998 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 10 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

Examples

Constants

This section is empty.

Variables

View Source
var DefaultCredentialGetter credentials.CredentialGetter = &lazyGitHubCredentials{}

DefaultCredentialGetter implements retrieving credentials for github.com.

It delegates to the provider-aware chain rather than assembling its own: the two copies drifted apart once already, and the copy here was the one that still knew the keyring settings macOS and pass need.

View Source
var Logger = logrus.New()

Logger provides the default logger for the whole maiao project

Functions

func GitHubAPIDomain

func GitHubAPIDomain(domain string) string

func NewClient

func NewClient(httpClient *http.Client, domain string) (*github.Client, error)

NewClient instanciates a new github client depending on the domain name

When requesting a client for a different host than github.com, a client for github enterprise is considered

Credentials are even taken from GITHUB_TOKEN environment variable or from your ~/.netrc file

Example
httpClient, err := NewHTTPClientForDomain(context.Background(), "github.com")
if err != nil {
	Logger.Errorf("failed to create http client: %s", err.Error())
}
client, err := NewClient(httpClient, "github.com")
if err != nil {
	Logger.Errorf("failed to create github client: %s", err.Error())
}
repo, _, err := client.Repositories.Get(context.Background(), "runetes", "maiao")
if err != nil {
	Logger.Errorf("failed to get github repository: %s", err.Error())
}
fmt.Println(repo.GetName())
Output:
maiao

func NewGraphQLClient

func NewGraphQLClient(httpClient *http.Client, domain string) (*api.GraphQLClient, error)

func NewHTTPClientForDomain

func NewHTTPClientForDomain(ctx context.Context, domain string) (*http.Client, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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