auth

package
v0.0.0-...-82ef3d0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

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

Auth is the representation of all the auth-related middlewares.

func New

func New(c *mongo.Collection) *Auth

New creates an Auth struct.

func (*Auth) HasToBeAuth

func (a *Auth) HasToBeAuth(next http.HandlerFunc) http.HandlerFunc

HasToBeAuth checks if the user is authenticated to go to the next http.HandlerFunc. PerformAuth has to be run before this middleware.

func (*Auth) HasToBeUnauth

func (a *Auth) HasToBeUnauth(next http.HandlerFunc) http.HandlerFunc

HasToBeUnauth checks if the user is unauthenticated to go to the next http.HandlerFunc. PerformAuth has to be run before this middleware.

func (*Auth) PerformAuth

func (a *Auth) PerformAuth(next http.HandlerFunc) http.HandlerFunc

PerformAuth performs the user authentication process.

Jump to

Keyboard shortcuts

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