Documentation ¶
Index ¶
- type Claims
- type Tokenizer
- func (t *Tokenizer) Generate(u *usermodel.Model, duration int64, subject, id, key string) (string, *Claims, error)
- func (t *Tokenizer) GenerateFromClaims(claims *Claims, duration int64, subject, key string) (string, *Claims, error)
- func (t *Tokenizer) GetClaims(tokenString, subject string) (bool, *Claims)
- func (t *Tokenizer) Validate(tokenString, subject string) (bool, *Claims)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Claims ¶
type Claims struct { jwt.StandardClaims Userid string `json:"userid"` AuthTags string `json:"auth_tags"` ID string `json:"id"` Key string `json:"key"` }
Claims is a set of fields to describe a user
type Tokenizer ¶
type Tokenizer struct {
// contains filtered or unexported fields
}
Tokenizer is a token generator
func (*Tokenizer) Generate ¶
func (t *Tokenizer) Generate(u *usermodel.Model, duration int64, subject, id, key string) (string, *Claims, error)
Generate returns a new jwt token from a user model
func (*Tokenizer) GenerateFromClaims ¶
func (t *Tokenizer) GenerateFromClaims(claims *Claims, duration int64, subject, key string) (string, *Claims, error)
GenerateFromClaims creates a new jwt from a set of claims
Click to show internal directories.
Click to hide internal directories.