Versions in this module Expand all Collapse all v0 v0.2.0 Feb 18, 2023 v0.1.0 Feb 18, 2023 Changes in this version + type IKey interface + GetCommonKey func() string + GetPrivateKey func() *rsa.PrivateKey + GetPublicKey func() *rsa.PublicKey + SetCommonKey func(secret string) + SetPrivateKey func(path string) + SetPublicKey func(path string) + type IToken interface + GetClaims func() *NewClaims + GetExpiresAt func() *jwt.NumericDate + GetSignAlgorithm func() SignAlgorithm + SetClaims func(claims any) + SetExpiresAt func(t int64) + SetRepeatExpiresAt func(t int64) + SetSecret func(secret string) + SetSignAlgorithm func(alg SignAlgorithm) + SignToken func() string + type Key struct + CommonKey string + PrivateKey *rsa.PrivateKey + PublicKey *rsa.PublicKey + func (k *Key) GetCommonKey() string + func (k *Key) GetPrivateKey() *rsa.PrivateKey + func (k *Key) GetPublicKey() *rsa.PublicKey + func (k *Key) SetCommonKey(secret string) + func (k *Key) SetPrivateKey(path string) + func (k *Key) SetPublicKey(path string) + type NewClaims struct + Claims any + type SignAlgorithm jwt.SigningMethod + var HMAC SignAlgorithm = jwt.SigningMethodHS256 + var RSA SignAlgorithm = jwt.SigningMethodRS256 + type Token struct + Claims *NewClaims + ExpiresAt *jwt.NumericDate + Jwt string + Key IKey + SignAlgorithm SignAlgorithm + func (tk *Token) GetClaims() *NewClaims + func (tk *Token) GetExpiresAt() *jwt.NumericDate + func (tk *Token) GetSignAlgorithm() SignAlgorithm + func (tk *Token) SetClaims(claims any) + func (tk *Token) SetExpiresAt(t int64) + func (tk *Token) SetRepeatExpiresAt(t int64) + func (tk *Token) SetSecret(secret string) + func (tk *Token) SetSignAlgorithm(alg SignAlgorithm) + func (tk *Token) SignToken() string