utils

package
v0.0.0-...-983419a Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Throw

func Throw(w http.ResponseWriter, exception *models.NegoError, err error)

Throw is a error handler function.

Types

type JWT

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

JWT abstracts necessary JWT fields.

func NewJWT

func NewJWT() *JWT

NewJWT returns a new instance of a predefined settings for JWT middlewares.

func (*JWT) Authenticate

func (j *JWT) Authenticate(r *http.Request) (string, error)

Authenticate goes throught a JWT validation process.

func (*JWT) Authenticator

func (j *JWT) Authenticator() func(http.Handler) http.Handler

Authenticator is a middleware for handling JWT.

func (*JWT) Decode

func (j *JWT) Decode(r *http.Request) string

Decode returns a JWT claim.

func (*JWT) Encode

func (j *JWT) Encode(email string) string

Encode uses user data for JWT encoding.

func (*JWT) Verifier

func (j *JWT) Verifier() func(http.Handler) http.Handler

Verifier finkds a token from a request.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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