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: 2

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