Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidToken = errors.New("invalid token") ErrExpiredToken = errors.New("token has expired") )
Functions ¶
This section is empty.
Types ¶
type Claims ¶
type Claims struct {
UserID uint `json:"user_id"`
Username string `json:"username"`
Role string `json:"role"`
jwt.RegisteredClaims
}
Claims represents the JWT claims
type Config ¶
type Config struct {
SecretKey string `yaml:"secret_key"`
Duration time.Duration `yaml:"duration"`
}
Config represents the JWT configuration
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service represents the JWT service
func (*Service) GenerateToken ¶
GenerateToken generates a new JWT token
Click to show internal directories.
Click to hide internal directories.