githubutil

package
v0.0.0-...-9a913ad Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

func NewApp

func NewApp(appID, installationID int64, keyFile string) (*App, error)

func (*App) JWT

func (a *App) JWT() (string, error)

func (*App) Token

func (a *App) Token(ctx context.Context) (string, error)

type GitHubClientFactory

type GitHubClientFactory struct {
	Initialized   bool
	REST          *github.Client
	GraphQL       *githubv4.Client
	TokenProvider *TokenProvider
	OAuthConfig   *oauth2.Config

	Name           string
	AppID          int64
	InstallationID int64
	PrivateKeyFile string
	// Token is the personal access token. Not an app token or an access token.
	// An access token will provided via TokenProvider.
	Token                 string
	GitHubAPIEndpoint     string
	GitHubGraphQLEndpoint string
	CACertFile            string
	ClientID              string
	ClientSecret          string
	RedirectURL           string
	// contains filtered or unexported fields
}

func NewGitHubClientFactory

func NewGitHubClientFactory(name string, requiredCredential bool) *GitHubClientFactory

func (*GitHubClientFactory) Flags

func (g *GitHubClientFactory) Flags(fs *cli.FlagSet)

func (*GitHubClientFactory) Init

func (g *GitHubClientFactory) Init() error

func (*GitHubClientFactory) PFlags

func (g *GitHubClientFactory) PFlags(fs *pflag.FlagSet)

type TokenProvider

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

func (*TokenProvider) Token

func (p *TokenProvider) Token(ctx context.Context) (string, error)

type Transport

type Transport struct {
	http.RoundTripper
	// contains filtered or unexported fields
}

func NewTransport

func NewTransport(tr http.RoundTripper, tokenProvider *TokenProvider) *Transport

func NewTransportWithApp

func NewTransportWithApp(tr http.RoundTripper, app *App) *Transport

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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