Documentation
¶
Index ¶
- type App
- func (a *App) Branches(ctx context.Context, installationID int64, repository string) ([]string, error)
- func (a *App) Commit(ctx context.Context, installationID int64, repository, ref string) (Commit, error)
- func (a *App) FindInstallation(ctx context.Context, repository string) (int64, error)
- func (a *App) Installation(ctx context.Context, installationID int64) (*Installation, error)
- func (a *App) InstallationID(ctx context.Context, userToken *oauth2.Token) (int64, error)
- func (a *App) InstallationToken(ctx context.Context, installationID int64) (string, error)
- func (a *App) InstallationTokenForRepo(ctx context.Context, installationID int64, repository string) (string, error)
- func (a *App) Installations(ctx context.Context) ([]Installation, error)
- func (a *App) UserInstallations(ctx context.Context, userToken *oauth2.Token) ([]Installation, error)
- type Commit
- type Installation
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 ¶
NewApp creates a new GitHub App client. privateKeyPath is the path to the GitHub App's PEM private key file.
func (*App) FindInstallation ¶
FindInstallation returns the installation ID of the GitHub App for the given repository. repository must be in "owner/repo" form. Uses app-level JWT auth (private key required).
func (*App) Installation ¶
Installation fetches a single GitHub App installation by ID.
func (*App) InstallationID ¶
InstallationID discovers the GitHub App installation ID for the authenticated user. Uses the user's OAuth token to query their installations and returns the one matching this App's ID.
func (*App) InstallationToken ¶
func (*App) InstallationTokenForRepo ¶
func (*App) Installations ¶
func (a *App) Installations(ctx context.Context) ([]Installation, error)
Installations lists all installations of this GitHub App. Uses the App's private key to authenticate as the app itself (JWT).
func (*App) UserInstallations ¶
func (a *App) UserInstallations(ctx context.Context, userToken *oauth2.Token) ([]Installation, error)
UserInstallations returns all GitHub App installations accessible to the user. Uses the user's OAuth token to query their installations.