basic

package
v2.6.11 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App of the package

func New

func New(provider Provider) App

New creates new App from Config

func (App) GetUser

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

GetUser returns User found in content header

func (App) IsMatching

func (a App) IsMatching(content string) bool

IsMatching checks if header content match provider

func (App) OnError

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

OnError handles HTTP request when login fails

type Provider added in v2.4.0

type Provider interface {
	// Login user with its credentials
	Login(ctx context.Context, login, password string) (model.User, error)
}

Provider check user credentials

Jump to

Keyboard shortcuts

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