Documentation ¶
Index ¶
- Variables
- type Guard
- func (g *Guard) Alg() *jwt.SigningMethodHMAC
- func (g *Guard) Auth(user authenticate.User) error
- func (g *Guard) Check() (authenticate.User, error)
- func (g *Guard) ExpireSecond() int64
- func (g *Guard) Key() ([]byte, error)
- func (g *Guard) ParseToken() error
- func (g *Guard) Token() Token
- func (g *Guard) User() authenticate.User
- type InvalidTokenError
- type Token
- type TokenProvider
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultAlg = jwt.SigningMethodHS512 DefaultExpireSecond int64 = 60 * 30 )
Functions ¶
This section is empty.
Types ¶
type Guard ¶
type Guard struct {
// contains filtered or unexported fields
}
func NewJwtGuard ¶
func NewJwtGuard(tokenProvider TokenProvider, userProvider authenticate.UserProvider, key []byte, expireSecond ...int64) *Guard
func (*Guard) ExpireSecond ¶
func (*Guard) ParseToken ¶
func (*Guard) User ¶
func (g *Guard) User() authenticate.User
type InvalidTokenError ¶
type InvalidTokenError string
func (InvalidTokenError) Error ¶
func (it InvalidTokenError) Error() string
type TokenProvider ¶
type User ¶
type User interface { authenticate.User GetJwtClaims() jwt.MapClaims }
Click to show internal directories.
Click to hide internal directories.