Documentation ¶
Index ¶
- func New(opts ...Option) (*jwt.GinJWTMiddleware, error)
- type Option
- func Authenticator(f func(c *gin.Context) (any, error)) Option
- func CookieName(cookieName string) Option
- func Key(key string) Option
- func LoginResponse(f func(c *gin.Context, code int, token string, expire time.Time)) Option
- func LogoutResponse(f func(c *gin.Context, code int)) Option
- func MaxRefresh(t time.Duration) Option
- func RefreshResponse(f func(c *gin.Context, code int, token string, expire time.Time)) Option
- func Timeout(t time.Duration) Option
- func TokenLookup(tokenLookup string) Option
- func Unauthorized(f func(c *gin.Context, code int, message string)) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*Options)
func CookieName ¶
func LoginResponse ¶
func MaxRefresh ¶
func RefreshResponse ¶
func TokenLookup ¶
type Options ¶
type Options struct { Key string Timeout time.Duration MaxRefresh time.Duration TokenLookup string Authenticator func(c *gin.Context) (any, error) LoginResponse func(c *gin.Context, code int, token string, expire time.Time) LogoutResponse func(c *gin.Context, code int) RefreshResponse func(c *gin.Context, code int, token string, expire time.Time) SendCookie bool CookieName string }
Click to show internal directories.
Click to hide internal directories.