Documentation ¶
Index ¶
- type AppTokenClaims
- type IJWTService
- type ILoginService
- type JWTService
- type LoginService
- func (ls LoginService) Constructor() *LoginService
- func (ls *LoginService) GetToken(req *http.Request) (string, error)
- func (ls *LoginService) InvalidateToken(token *jwt.Token, tokenStr string)
- func (ls *LoginService) IsInvalidToken(tokenStr string) bool
- func (ls *LoginService) SetToken(res http.ResponseWriter, tokenStr string, exp time.Time)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppTokenClaims ¶
type AppTokenClaims struct { Name string `json:"name"` // username jwt.StandardClaims }
type IJWTService ¶
type ILoginService ¶
type JWTService ¶
type JWTService struct {
// contains filtered or unexported fields
}
func (JWTService) Constructor ¶
func (manager JWTService) Constructor() *JWTService
func (*JWTService) Sign ¶
func (manager *JWTService) Sign(claims jwt.Claims) (string, error)
func (*JWTService) Validate ¶
func (manager *JWTService) Validate(tokenStr string, claims jwt.Claims) (*jwt.Token, error)
type LoginService ¶
func (LoginService) Constructor ¶
func (ls LoginService) Constructor() *LoginService
func (*LoginService) InvalidateToken ¶
func (ls *LoginService) InvalidateToken(token *jwt.Token, tokenStr string)
func (*LoginService) IsInvalidToken ¶
func (ls *LoginService) IsInvalidToken(tokenStr string) bool
func (*LoginService) SetToken ¶
func (ls *LoginService) SetToken(res http.ResponseWriter, tokenStr string, exp time.Time)
Click to show internal directories.
Click to hide internal directories.