github

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGitHubIdentityFromConfig

func NewGitHubIdentityFromConfig(ctx context.Context, cfg *config.APIGitHubIdentityConfig, opts ...Option) (tokenprovider.TokenProvider, error)

NewGitHubIdentityFromConfig constructs a GitHub identity from application config. It resolves credentials, validates the configuration, and returns the appropriate TokenProvider implementation based on the credential type.

Types

type App

type App struct {
	ClientID       string
	InstallationID int64
	PrivateKey     *rsa.PrivateKey
	Hostname       string
	// contains filtered or unexported fields
}

App implements tokenprovider.TokenProvider using App App installation tokens.

func NewGitHubAppIdentity

func NewGitHubAppIdentity(clientID string, installationID int64, key *rsa.PrivateKey, hostname string, opts ...Option) (*App, error)

NewGitHubAppIdentity constructs a GitHub identity from resolved values.

func (*App) GetToken

func (*App) Name

func (g *App) Name() string

type Option

type Option func(*App)

Option configures a GitHub identity.

func WithHTTPClient

func WithHTTPClient(client *httpc.Client) Option

WithHTTPClient overrides the default HTTP client.

func WithManager

func WithManager(mgr *manager.Manager[string, tokenprovider.Token]) Option

WithManager overrides the cache manager.

func WithTokenURL

func WithTokenURL(url string) Option

WithTokenURL overrides the computed token endpoint URL (for testing).

type PAT

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

PAT implements tokenprovider.TokenProvider using a static Personal Access Token. PATs do not expire from the API's perspective (they have user-configured lifetimes), so no caching or refresh logic is needed.

func NewPATIdentity

func NewPATIdentity(token string) (*PAT, error)

NewPATIdentity constructs a GitHub PAT identity from a resolved token string.

func (*PAT) GetToken

func (*PAT) Name

func (p *PAT) Name() string

Jump to

Keyboard shortcuts

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