Documentation ¶
Index ¶
- Variables
- func BcryptCheck(password, hash string) bool
- func BcryptHash(password string) string
- func ClearToken(w http.ResponseWriter, r *http.Request)
- func GetClaims(r *http.Request) (*types.CustomClaims, error)
- func GetToken(r *http.Request) string
- func GetUserId(r *http.Request) int64
- func MD5V(str []byte, b ...byte) string
- func ParseDuration(d string) (time.Duration, error)
- func SetToken(w http.ResponseWriter, r *http.Request, token string, maxAge int)
- type JWT
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func BcryptCheck ¶
func BcryptHash ¶
func ClearToken ¶
func ClearToken(w http.ResponseWriter, r *http.Request)
Types ¶
type JWT ¶
func (*JWT) CreateClaims ¶
func (j *JWT) CreateClaims(baseClaims types.BaseClaims) types.CustomClaims
func (*JWT) GenerateToken ¶
func (j *JWT) GenerateToken(claims *types.CustomClaims) (string, error)
func (*JWT) ParseToken ¶
func (j *JWT) ParseToken(tokenString string) (*types.CustomClaims, error)
解析 token
Click to show internal directories.
Click to hide internal directories.