Documentation ¶
Index ¶
Constants ¶
View Source
const ( MinCost int = 4 MaxCost int = 34 DefaultCost int = 10 )
Variables ¶
Functions ¶
func CheckPasswordHash ¶
func HashPassword ¶
Types ¶
type JWT ¶
type JWT interface { CreateToken(user *User, duration time.Duration) (*JWTPayload, error) VerifyToken(tokn string) (*JWTPayload, error) }
type JWTPayload ¶
type JWTPayload struct { ID int `json:"id"` Email string `json:"email"` ExpiresAt time.Time `json:"expires_at"` IssuedAt time.Time `json:"issued_at"` Token string `json:"token"` }
func (*JWTPayload) Valid ¶
func (j *JWTPayload) Valid() error
type JWTToken ¶
type JWTToken struct {
// contains filtered or unexported fields
}
func (*JWTToken) CreateToken ¶
func (*JWTToken) VerifyToken ¶
func (j *JWTToken) VerifyToken(tokn string) (*JWTPayload, error)
Click to show internal directories.
Click to hide internal directories.