Documentation ¶
Index ¶
- func ComparePassword(hashed string, normal string) error
- func GenerateToken(username string, callbacks ...func(*Claims)) (string, error)
- func HashPassword(s string) string
- func JwtHandler(opts ApiSecurityOptions) gin.HandlerFunc
- func RefreshToken(tknStr string) (string, error)
- type ApiSecurityOptions
- type Claims
- type CustomClaims
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComparePassword ¶
func GenerateToken ¶
func HashPassword ¶
func JwtHandler ¶
func JwtHandler(opts ApiSecurityOptions) gin.HandlerFunc
func RefreshToken ¶
Types ¶
type ApiSecurityOptions ¶
type Claims ¶
type Claims struct { Username string `json:"username"` jwt.RegisteredClaims }
Create a struct that will be encoded to a JWT. We add jwt.RegisteredClaims as an embedded type, to provide fields like expiry time
func ValidateToken ¶
type CustomClaims ¶
Click to show internal directories.
Click to hide internal directories.