libgh

package
v0.0.0-...-26736ab Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2019 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoAuth error = errors.New("not authenticated")

ErrNoAuth indicates that no user is authenticated with GitHub

Functions

func NewClient

func NewClient(ctx context.Context, etcdKV etcd.KeysAPI) (*github.Client, error)

NewClient makes a new GitHub client with authentication

Types

type ExchangeGitHubCodeReq

type ExchangeGitHubCodeReq struct {
	// ClientID is the GitHub app's Client ID
	ClientID string `json:"client_id"`

	// ClientSecret is the GitHub app's client secret
	ClientSecret string `json:"client_secret"`

	// Code is the temporary GitHub authentication code
	Code string `json:"code"`
}

ExchangeGitHubCodeReq holds the parameters required to make a GitHub API request to exchange a temporary GitHub code for a longer lasting GitHub token

func NewExchangeGitHubCodeReq

func NewExchangeGitHubCodeReq(cfg *config.Config, code string) ExchangeGitHubCodeReq

NewExchangeGitHubCodeReq creates a new ExchangeGitHubCodeReq. Most of the fields can be filled by passing an config.Config object

func (ExchangeGitHubCodeReq) Exchange

func (r ExchangeGitHubCodeReq) Exchange() (string, error)

Exchange exchanges a temporary GitHub code for a longer lasting GitHub token

Jump to

Keyboard shortcuts

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