Versions in this module Expand all Collapse all v0 v0.0.2 Nov 2, 2023 v0.0.1 Nov 2, 2023 Changes in this version + var HS256 = jwt.SigningMethodHS256 + var HS384 = jwt.SigningMethodHS384 + var HS512 = jwt.SigningMethodHS512 + func GenerateCustomToken(kv map[string]interface{}) (string, error) + func GenerateToken(uid string, role ...string) (string, error) + func Init(opts ...Option) + type Claims struct + Role string + UID string + func ParseToken(tokenString string) (*Claims, error) + type CustomClaims struct + Fields KV + func ParseCustomToken(tokenString string) (*CustomClaims, error) + func (c *CustomClaims) Get(key string) (val interface{}, isExist bool) + type KV = map[string]interface + type Option func(*options) + func WithExpire(d time.Duration) Option + func WithIssuer(issuer string) Option + func WithSigningKey(key string) Option + func WithSigningMethod(sm *jwt.SigningMethodHMAC) Option