auth

package
v0.0.0-...-73a25eb Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2015 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TokenDuration int = 20

Functions

This section is empty.

Types

type JWTAuth

type JWTAuth struct {
	PublicKey *rsa.PublicKey
	// contains filtered or unexported fields
}

func GetJWTAuthInstance

func GetJWTAuthInstance() *JWTAuth

func (*JWTAuth) Authenticate

func (a *JWTAuth) Authenticate(req *User) func(*User) (bool, error)

func (*JWTAuth) GenerateToken

func (a *JWTAuth) GenerateToken(userID string) (string, error)

func (*JWTAuth) IsValidToken

func (a *JWTAuth) IsValidToken(r *http.Request) (bool, error)

type User

type User struct {
	Username string
	Password string
}

Jump to

Keyboard shortcuts

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