Documentation ¶
Index ¶
- type Authorizer
- type MapClaims
- type Middleware
- type Provider
- func (provider *Provider) CreateToken(userID, accountID, socialAccountID uint64) (string, time.Time, error)
- func (provider *Provider) ExtractTokenData(token *Token) (*TokenData, error)
- func (provider *Provider) Middleware() *jwtmiddleware.JWTMiddleware
- func (provider *Provider) MiddlewareOptions() *jwtmiddleware.Options
- type Token
- type TokenData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authorizer ¶
type Authorizer struct {
// contains filtered or unexported fields
}
func NewAuthorizer ¶
func NewAuthorizer(jwtProvider *Provider) *Authorizer
func (*Authorizer) AuthorizerCode ¶
func (au *Authorizer) AuthorizerCode() string
type MapClaims ¶
type MapClaims = jwt.MapClaims
MapClaims describes the Claims type that uses the map[string]interface{} for JSON decoding This is the default claims type if you don't supply one
type Provider ¶
type Provider struct { // TokenLifetime defineds the valid time-period of token TokenLifetime time.Duration // Secret of session generation Secret string // MiddlewareOpts to get middelware procedure MiddlewareOpts *jwtmiddleware.Options }
Provider to JWT constructions
func NewDefaultProvider ¶
NewDefaultProvider returns new provider
func (*Provider) CreateToken ¶
func (provider *Provider) CreateToken(userID, accountID, socialAccountID uint64) (string, time.Time, error)
CreateToken new token for user ID
func (*Provider) ExtractTokenData ¶
ExtractTokenData into the token struct
func (*Provider) Middleware ¶
func (provider *Provider) Middleware() *jwtmiddleware.JWTMiddleware
Middleware returns middleware object with custom validation procedure
func (*Provider) MiddlewareOptions ¶
func (provider *Provider) MiddlewareOptions() *jwtmiddleware.Options
MiddlewareOptions returns the options of middelware
Click to show internal directories.
Click to hide internal directories.