lib

package
v0.0.0-...-cf2deb9 Latest Latest
Warning

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

Go to latest
Published: May 13, 2016 License: AGPL-3.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const DefaultJWTKey = "secret"
View Source
const DefaultJWTSigningMethod = "HS256"

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator struct {
	JWTKey           string
	JWTSigningMethod string
}

func NewAuthenticator

func NewAuthenticator(key, method string) *Authenticator

func (*Authenticator) CreateToken

func (a *Authenticator) CreateToken(user *entities.User) (string, error)

func (*Authenticator) CreateUserFromToken

func (a *Authenticator) CreateUserFromToken(token string) (*entities.User, error)

func (*Authenticator) JWTHandlerFunc

func (a *Authenticator) JWTHandlerFunc(handler http.HandlerFunc) http.HandlerFunc

Jump to

Keyboard shortcuts

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