Documentation ¶
Index ¶
- type ITokenService
- type JWTClaims
- type JWTService
- func (service *JWTService) GenerateToken(info interface{}) (string, error)
- func (service *JWTService) GetRequestContextInfo(request *http.Request) interface{}
- func (service *JWTService) ParseToken(tokenString string) (interface{}, bool)
- func (service *JWTService) RefreshToken(string) (string, error)
- func (service *JWTService) RevokeOtherTokens(string) error
- func (service *JWTService) RevokeToken(string) error
- func (service *JWTService) UpdateRequestContext(token interface{}, request *http.Request) *http.Request
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ITokenService ¶
type ITokenService interface { GenerateToken(interface{}) (string, error) ParseToken(string) (interface{}, bool) UpdateRequestContext(interface{}, *http.Request) *http.Request GetRequestContextInfo(*http.Request) interface{} RefreshToken(string) (string, error) RevokeToken(string) error RevokeOtherTokens(string) error }
func NewJWTService ¶
func NewJWTService() ITokenService
type JWTClaims ¶
type JWTClaims struct { jwt.StandardClaims Info interface{} }
type JWTService ¶
type JWTService struct {
// contains filtered or unexported fields
}
func (*JWTService) GenerateToken ¶
func (service *JWTService) GenerateToken(info interface{}) (string, error)
func (*JWTService) GetRequestContextInfo ¶
func (service *JWTService) GetRequestContextInfo( request *http.Request, ) interface{}
func (*JWTService) ParseToken ¶
func (service *JWTService) ParseToken(tokenString string) (interface{}, bool)
func (*JWTService) RefreshToken ¶
func (service *JWTService) RefreshToken(string) (string, error)
TODO: need to implement
func (*JWTService) RevokeOtherTokens ¶
func (service *JWTService) RevokeOtherTokens(string) error
TODO: need to implement
func (*JWTService) RevokeToken ¶
func (service *JWTService) RevokeToken(string) error
TODO: need to implement
func (*JWTService) UpdateRequestContext ¶
func (service *JWTService) UpdateRequestContext( token interface{}, request *http.Request, ) *http.Request
Click to show internal directories.
Click to hide internal directories.