Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
Auth struct
func (*Auth) GenerateToken ¶
GenerateToken return new TokenInfo, generate new access and refresh token
func (*Auth) ParseUserID ¶
ParseUserID parse user_id from token
type IJWTAuth ¶
type IJWTAuth interface { GenerateToken(userID string) (TokenInfo, error) RefreshToken(refreshToken string) (TokenInfo, error) ParseUserID(accessToken string, refresh bool) (string, error) }
IJWTAuth interface
type Option ¶
type Option func(*options)
Option jwt option
func WithExpiredRefresh ¶
WithExpiredRefresh set expired for refresh token
func WithKeyFuncRefresh ¶
func WithKeyFuncRefresh(keyFunc jwt.Keyfunc) Option
WithKeyFuncRefresh set key function for refresh token
func WithSigningKeyRefresh ¶
func WithSigningKeyRefresh(key interface{}) Option
WithSigningKeyRefresh set signing key for refresh token
Click to show internal directories.
Click to hide internal directories.