github

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config Config) (ident.Auth, error)

New creates new App from Config

Types

type App

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

App of package

func (*App) GetName

func (*App) GetName() string

GetName returns Authorization header prefix

func (*App) GetUser

func (a *App) GetUser(ctx context.Context, header string) (*model.User, error)

GetUser returns User associated to header

func (*App) Login

func (a *App) Login(r *http.Request) (string, error)

Login exchanges code for token

func (*App) OnLoginError

func (*App) OnLoginError(w http.ResponseWriter, r *http.Request, _ error)

OnLoginError handle action when login fails

func (*App) Redirect

func (a *App) Redirect(w http.ResponseWriter, r *http.Request)

Redirect redirects user to GitHub endpoint

type Config

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

Config of package

func Flags

func Flags(fs *flag.FlagSet, prefix string) Config

Flags adds flags for configuring package

Jump to

Keyboard shortcuts

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