jwt

package
v0.0.0-...-9b07b7c Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service provides a Json-Web-Token authentication implementation

func New

func New(secret, algo string, d int) *Service

New generates new JWT service necessery for auth middleware

func (*Service) GenerateToken

func (j *Service) GenerateToken(u *schemago.SUser) (string, string, error)

GenerateToken generates new JWT token and populates it with user data

func (*Service) MWFunc

func (j *Service) MWFunc() echo.MiddlewareFunc

MWFunc makes JWT implement the Middleware interface.

func (*Service) ParseToken

func (j *Service) ParseToken(c echo.Context) (*jwt.Token, error)

ParseToken parses token from Authorization header

Jump to

Keyboard shortcuts

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