githubutil

package
v0.0.0-...-5491237 Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: MIT Imports: 23 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

	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
	// 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 Mock

type Mock struct {
	Repositories map[string]*Repository
	// contains filtered or unexported fields
}

func NewMock

func NewMock() *Mock

func (*Mock) Client

func (m *Mock) Client() *github.Client

func (*Mock) RegisterResponder

func (m *Mock) RegisterResponder(tr *httpmock.MockTransport)

func (*Mock) RegisteredTransport

func (m *Mock) RegisteredTransport() *httpmock.MockTransport

func (*Mock) Repository

func (m *Mock) Repository(name string) *Repository

type PullRequest

type PullRequest struct {
	github.PullRequest

	Comments []*github.PullRequestComment
}

type Repository

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

func (*Repository) AssertPullRequest

func (r *Repository) AssertPullRequest(t *testing.T, number int) *PullRequest

func (*Repository) GetPullRequest

func (r *Repository) GetPullRequest(num int) *PullRequest

func (*Repository) NextIndex

func (r *Repository) NextIndex() int

func (*Repository) PullRequests

func (r *Repository) PullRequests(pullRequests ...*github.PullRequest)

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