basic

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: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config Config, db *sql.DB) (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 exchange state to token

func (App) OnLoginError

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

OnLoginError handle action when login fails

func (App) Redirect

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

Redirect redirects user to login 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