Versions in this module Expand all Collapse all v1 v1.2.0 May 15, 2025 Changes in this version type Operator + Enable bool + func (h *Operator) GenerateTokenWithTTL(user Claims, ttl time.Duration) (TokenResponse, error) v1.1.0 Apr 20, 2025 Changes in this version + var ErrExpiredToken = errors.New("token has expired") + var ErrInvalidToken = errors.New("invalid token") + var ErrInvalidType = errors.New("invalid token type") + type Claims struct + Email string + UserID int + type Operator struct + JWTDuration time.Duration + JWTSecret string + func NewOperator(secret string, duration time.Duration) *Operator + func (h *Operator) GenerateToken(user Claims) (TokenResponse, error) + func (h *Operator) ValidateToken(tokenString string) (Claims, error) + type TokenResponse struct + ExpiresAt time.Time + Token string