githubx

package
v0.0.0-...-da893e2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2020 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Overview

Package githubx extends operations in the google/go-github package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAppClient

func NewAppClient(privateKey string, appID, installationID int64) *github.Client

NewAppClient creates a new *github.Client authenticated using the given privateKey file name, appID, and installationID. Future operations are performed as the Github App associated with these parameters.

func NewClient

func NewClient(installationID int64) *github.Client

NewClient creates a new, authenticated *github.Client. Depending on the value of installationID, NewClient performs authentication using available environment variables. If required environment variables are not found, NewClient logs a warning and returns nil.

If the installationID is zero, then NewClient authenticates using a personal access token from the GITHUB_AUTH_TOKEN environment vairable. Personal access tokens perform actions as the user associated with the token.

If the installationID is not zero, then NewClient authenticates using a Github App private key read from the absolute path contained in GITHUB_PRIVATE_KEY and the Github App ID (About -> ID, *not* "OAuth Client ID") contained in the GITHUB_APP_ID environment variables. Both values are created during Github App registration. Github Apps perform actions as the application not as a user, so permissions may have different restrictions.

Multiple users may install a single Github App, so each installation receives a unique "installation ID". All events related to a specific installation include the installation ID.

func NewPersonalClient

func NewPersonalClient(authToken string) *github.Client

NewPersonalClient creates a *github.Client authenticated using the given Github authToken. Future operations are performed as the user associated with the token.

Types

This section is empty.

Directories

Path Synopsis
Package webhook defines a generic handler for GitHub App & Webhook events.
Package webhook defines a generic handler for GitHub App & Webhook events.

Jump to

Keyboard shortcuts

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