Documentation ¶
Index ¶
- Constants
- func DecodeToken(tk string) (token.Token, error)
- func DecodeTokenNoBase64(tk string) (token.Token, error)
- func VerifyToken(tk string, key token.Key) (token.Token, error)
- func VerifyTokenNoBase64(tk string, key token.Key) (token.Token, error)
- type Authenticate
- func (t *Authenticate) Check(secretKey string, tok string, opts ...token.Option) (token.Token, error)
- func (t *Authenticate) Create(secretKey string, expireSeconds int64, opts ...token.Option) (token.Token, error)
- func (t *Authenticate) Decode(tok string, opts ...token.Option) (token.Token, error)
- func (t *Authenticate) EnableFlag(secretKey string) int
- func (t *Authenticate) SetEnabled(secretKey string, enable bool)
- func (t *Authenticate) Type() string
- type Token
- type UpdateJWTClaims
Constants ¶
View Source
const Type = "jwt"
Variables ¶
This section is empty.
Functions ¶
func DecodeTokenNoBase64 ¶ added in v0.5.42
func VerifyToken ¶
VerifyToken 需要认证,解包里面的信息
Types ¶
type Authenticate ¶
type Authenticate struct {
// contains filtered or unexported fields
}
func New ¶ added in v0.5.13
func New(secret token.Secret) *Authenticate
func (*Authenticate) Check ¶
func (t *Authenticate) Check(secretKey string, tok string, opts ...token.Option) (token.Token, error)
Check implement token.Authenticate interface
func (*Authenticate) Create ¶
func (t *Authenticate) Create(secretKey string, expireSeconds int64, opts ...token.Option) (token.Token, error)
Create implement token.Authenticate interface
func (*Authenticate) EnableFlag ¶ added in v0.5.19
func (t *Authenticate) EnableFlag(secretKey string) int
EnableFlag implement token.Authenticate interface
func (*Authenticate) SetEnabled ¶
func (t *Authenticate) SetEnabled(secretKey string, enable bool)
SetEnabled implement token.Authenticate interface
func (*Authenticate) Type ¶
func (t *Authenticate) Type() string
type Token ¶
type Token struct { Uid string `json:"uid"` Token string `json:"token"` Session string `json:"-"` //for server and server Extend string `json:"-"` Source token.Source `json:"-"` // contains filtered or unexported fields }
type UpdateJWTClaims ¶ added in v1.4.20
Click to show internal directories.
Click to hide internal directories.