apps

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2019 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client(appID, installationID int64, privateKey []byte) (*github.Client, error)

Types

type Transport

type Transport struct {
	BaseURL string // baseURL is the scheme and host for GitHub API, defaults to https://api.github.com
	// contains filtered or unexported fields
}

Transport provides a http.RoundTripper by wrapping an existing http.RoundTripper and provides GitHub App authentication as an installation.

See https://developer.github.com/apps/building-integrations/setting-up-and-registering-github-apps/about-authentication-options-for-github-apps/#authenticating-as-an-installation

func NewTransport

func NewTransport(tr http.RoundTripper, appID, installationID int64, privateKey []byte) (*Transport, error)

NewTransport returns an Transport using private key. The key is parsed and if any errors occur the transport is nil and error is non-nil.

The provided tr http.RoundTripper should be shared between multiple installations to ensure reuse of underlying TCP connections.

The returned Transport is safe to be used concurrently.

func NewTransportFromKeyFile

func NewTransportFromKeyFile(tr http.RoundTripper, appID, installationID int64, privateKeyFile string) (*Transport, error)

NewTransportFromKeyFile returns an Transport using a private key from file.

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements http.RoundTripper interface.

Jump to

Keyboard shortcuts

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