jwt

package
Version: v0.0.0-...-faa3d42 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JWT

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

JWT contains data necessery for jwt auth

func New

func New(key string, duration int, algo string) *JWT

New instantiates new JWT service

func (*JWT) GenerateToken

func (j *JWT) GenerateToken(u *easypay.AuthUser) (string, error)

GenerateToken generates new jwt token

func (*JWT) ParseToken

func (j *JWT) ParseToken(token string) (*easypay.AuthUser, error)

ParseToken parses the bearer token

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL