auth

package module
v0.0.0-...-bcf3573 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2018 License: MIT Imports: 4 Imported by: 1

README

auth

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidToken = errors.New("invalid token")
	ErrUnexpected   = errors.New("unexpected error")
)

var algorithm = jwt.HmacSha256("LF7uXyDnuuKoUYonzboPgCQ0h33Nc7P8UWZ9Y5nW")

Functions

This section is empty.

Types

type Auth

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

func New

func New(key string) *Auth

func (*Auth) CreateJWT

func (auth *Auth) CreateJWT(daysNotBefore, daysExpire int, email string) string

func (*Auth) VerifyAndReadToken

func (auth *Auth) VerifyAndReadToken(token string) (email string, err error)

Jump to

Keyboard shortcuts

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