Documentation ¶
Index ¶
- Constants
- func DecodeToken(tk string) (token.Token, error)
- func VerifyToken(tk string, key token.Key) (token.Token, error)
- type Authenticate
- func (t *Authenticate) Check(source token.Source, tok string) (token.Token, error)
- func (t *Authenticate) Create(source token.Source, expireSeconds int64) (token.Token, error)
- func (t *Authenticate) Decode(source token.Source, tok string) (token.Token, error)
- func (t *Authenticate) EnableFlag(source token.Source) int
- func (t *Authenticate) SetEnabled(source token.Source, enable bool)
- func (t *Authenticate) Type() string
- type Token
- func (tk *Token) GetExtend() string
- func (tk *Token) GetSession() token.Session
- func (tk *Token) GetToken() string
- func (tk *Token) Update() (string, error)
- func (tk *Token) WithExtend(extend string) token.Token
- func (tk *Token) WithSession(session token.Session) token.Token
- func (tk *Token) WithSource(source token.Source) token.Token
Constants ¶
View Source
const Type = "jwt"
Variables ¶
This section is empty.
Functions ¶
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) EnableFlag ¶ added in v0.5.19
func (t *Authenticate) EnableFlag(source token.Source) int
EnableFlag implement token.Authenticate interface
func (*Authenticate) SetEnabled ¶
func (t *Authenticate) SetEnabled(source token.Source, enable bool)
SetEnabled implement token.Authenticate interface
func (*Authenticate) Type ¶
func (t *Authenticate) Type() string
type Token ¶
type Token struct { token.Session Token string `json:"token"` Extend string `json:"-"` // contains filtered or unexported fields }
func (*Token) GetSession ¶
GetSession token.Token interface
func (*Token) WithExtend ¶
WithExtend token.Token interface
func (*Token) WithSession ¶
WithSession token.Token interface
Click to show internal directories.
Click to hide internal directories.