Documentation
¶
Index ¶
- Constants
- func GetEdDSAPrivateKey(data []byte) ed25519.PrivateKey
- func GetKeyBytes(key string) []byte
- func GetRSAPrivateKey(data []byte) *rsa.PrivateKey
- type JwtToken
- type Token
- func (t *Token) GenerateAccessToken(payload map[string]any) (string, error)
- func (t *Token) GenerateRefreshToken(payload map[string]any) (string, error)
- func (t *Token) ParseRefreshToken(refreshToken string) (map[string]any, error)
- func (t *Token) VerifyToken(accessToken string) (map[string]any, error)
- func (t *Token) VerifyTokenMiddleware() gin.HandlerFunc
Constants ¶
View Source
const ( AccessTokenType = "access_token" RefreshTokenType = "refresh_token" )
Variables ¶
This section is empty.
Functions ¶
func GetEdDSAPrivateKey ¶
func GetEdDSAPrivateKey(data []byte) ed25519.PrivateKey
func GetKeyBytes ¶
func GetRSAPrivateKey ¶
func GetRSAPrivateKey(data []byte) *rsa.PrivateKey
Types ¶
type JwtToken ¶
type Token ¶
type Token struct {
Algorithm string
SigningKey any
VerifyingKey string
AccessTokenTimeout time.Duration
RefreshTokenTimeout time.Duration
}
func (*Token) GenerateAccessToken ¶
func (*Token) GenerateRefreshToken ¶
func (*Token) ParseRefreshToken ¶
func (*Token) VerifyTokenMiddleware ¶
func (t *Token) VerifyTokenMiddleware() gin.HandlerFunc
Click to show internal directories.
Click to hide internal directories.