github

package
v0.0.0-...-7f6b342 Latest Latest
Warning

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

Go to latest
Published: May 22, 2016 License: MIT Imports: 6 Imported by: 0 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

This section is empty.

Functions

func New

func New(c *config.Auth) auth.Provider

New creates a new Github provider from a configuration.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config is an implementation of `auth.Provider` for authenticating using a Github account.

func (*Config) Exchange

func (c *Config) Exchange(code string) (*oauth2.Token, error)

Exchange authorizes the session and returns an access token.

func (*Config) Name

func (c *Config) Name() string

Name returns the name of the provider.

func (*Config) Revoke

func (c *Config) Revoke(token *oauth2.Token) error

GitHub doesn't seem to allow token revocation - tokens are indefinite and there are no refresh options etc. Returns nil to satisfy the Provider interface.

func (*Config) StartSession

func (c *Config) StartSession(state string) *auth.Session

StartSession retrieves an authentication endpoint from Github.

func (*Config) Username

func (c *Config) Username(token *oauth2.Token) string

Username retrieves the username portion of the user's email address.

func (*Config) Valid

func (c *Config) Valid(token *oauth2.Token) bool

Valid validates the oauth token.

Jump to

Keyboard shortcuts

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