Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SubscriberAuth ¶
type SubscriberAuth struct { Token string // Token Expiration time.Duration // 过期时间 SecretKey string // 密钥 }
func (*SubscriberAuth) GenToken ¶
func (sa *SubscriberAuth) GenToken(role, username string) (token string, err error)
GenToken 生成JWT token
func (*SubscriberAuth) ValidateToken ¶
func (sa *SubscriberAuth) ValidateToken(tokenString string) (bool, error)
ValidateToken 验证和检查是否过期
Click to show internal directories.
Click to hide internal directories.