Documentation ¶
Index ¶
- Variables
- func Hash(password string) (encodedHash string, err error)
- func SignToken(claims jwt.StandardClaims) (token string, err error)
- func Validate(s interface{}) error
- func Verify(password, encodedHash string) (match bool, err error)
- func VerifyToken(token string, issuer string) (claims *jwt.StandardClaims, err error)
- type ValidationErrorJSON
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidHash error ErrInvalidHash = errors.New("the encoded hash is not in the correct format") // ErrIncompatibleVersion error ErrIncompatibleVersion = errors.New("incompatible version of argon2") )
View Source
var Validator = validator.New()
Validator instance
Functions ¶
func SignToken ¶
func SignToken(claims jwt.StandardClaims) (token string, err error)
SignToken sign jwt token using JWT_SECRET
func VerifyToken ¶
func VerifyToken(token string, issuer string) (claims *jwt.StandardClaims, err error)
VerifyToken verify token
Types ¶
type ValidationErrorJSON ¶
type ValidationErrorJSON struct { Key string `json:"key"` Message string `json:"message"` // contains filtered or unexported fields }
ValidationErrorJSON struct
Click to show internal directories.
Click to hide internal directories.