authentication

package
v0.0.0-...-bd79b31 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authentication

type Authentication interface {
	GenerateToken(user domain.User) (string, error)
	ValidateToken(tokenString string) (userID int64, err error)
	HashPassword(password string) (string, error)
	CheckPasswordHash(hash, password string) bool
}

type JWTAuthentication

type JWTAuthentication struct {
}

func NewAuthentication

func NewAuthentication() *JWTAuthentication

func (*JWTAuthentication) CheckPasswordHash

func (auth *JWTAuthentication) CheckPasswordHash(hash, password string) bool

func (*JWTAuthentication) GenerateToken

func (auth *JWTAuthentication) GenerateToken(user domain.User) (string, error)

func (*JWTAuthentication) HashPassword

func (auth *JWTAuthentication) HashPassword(password string) (string, error)

func (*JWTAuthentication) ValidateToken

func (auth *JWTAuthentication) ValidateToken(tokenString string) (userID int64, err error)

Jump to

Keyboard shortcuts

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