github

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInstallationToken

func GetInstallationToken(
	baseURL string,
	uploadURL string,
	appID int64,
	installationID int64,
	keyPEM []byte,
) (string, time.Time, error)

GetInstallationToken returns an installation token and its expiry time for the given baseURL, uploadURL, appID, and installationID. It uses the provided ASCII-armored x509 certificate key to sign a JSON web token that is then exchanged for the installation token. If baseURL is the empty string, the client used in this process will be one for github.com. Otherwise, the client will be one for GitHub Enterprise.

func NewClientFromBearerToken

func NewClientFromBearerToken(
	baseURL string,
	uploadURL string,
	token string,
) (*github.Client, error)

NewClientFromBearerToken returns a new github.Client for the given baseURL, uploadURL and bearer token. If baseURL is the empty string, the client will be for github.com. Otherwise, the client will be one for GitHub Enterprise.

func NewClientFromInstallationToken

func NewClientFromInstallationToken(
	baseURL string,
	uploadURL string,
	token string,
) (*github.Client, error)

NewClientFromInstallationToken returns a new github.Client for the given baseURL, uploadURL and installation token. If baseURL is the empty string, the client will be for github.com. Otherwise, the client will be one for GitHub Enterprise.

func NewClientFromKeyPEM

func NewClientFromKeyPEM(
	baseURL string,
	uploadURL string,
	appID int64,
	installationID int64,
	keyPEM []byte,
) (*github.Client, error)

NewClientFromKeyPEM returns a new github.Client for the given baseURL, uploadURL, appID, and installationID. It uses the provided ASCII-armored x509 certificate key to sign a JSON web token that is then exchanged for an installation token that will ultimately be used by the returned client. If baseURL is the empty string, the client will be for github.com. Otherwise, the client will be one for GitHub Enterprise.

Types

This section is empty.

Jump to

Keyboard shortcuts

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