Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidToken = errors.New("invalid token")
)
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type JWTAuthenticator ¶
type JWTAuthenticator struct {
// contains filtered or unexported fields
}
func NewJWTAuthenticator ¶
func NewJWTAuthenticator(secretKey string, ttlMinutes int) *JWTAuthenticator
func (*JWTAuthenticator) GenerateToken ¶
func (*JWTAuthenticator) VerifyToken ¶
func (jm *JWTAuthenticator) VerifyToken(ctx context.Context, token string) (*models.RequestUser, error)
Click to show internal directories.
Click to hide internal directories.