Documentation ¶
Index ¶
- type ClaimMap
- type ConfigMap
- type Token
- func (this *Token) Decode(data string, passphrase string, iv string) string
- func (this *Token) Encode(data string, passphrase string, iv string) string
- func (this *Token) FileExist(fp string) bool
- func (this *Token) FormatPath(file string) string
- func (this *Token) GetAccessExpiresIn() int
- func (this *Token) GetAccessTokenClaims(token string, verify ...bool) (jwt.MapClaims, error)
- func (this *Token) GetAccessTokenData(token string, key string, verify ...bool) string
- func (this *Token) GetConfig(key string) any
- func (this *Token) GetDataFromTokenClaims(claims jwt.MapClaims, key string) string
- func (this *Token) GetFromTokenClaims(claims jwt.MapClaims, key string) any
- func (this *Token) GetIntConfig(key string, defVal int) int
- func (this *Token) GetRefreshExpiresIn() int
- func (this *Token) GetRefreshTokenClaims(token string, verify ...bool) (jwt.MapClaims, error)
- func (this *Token) GetRefreshTokenData(token string, key string, verify ...bool) string
- func (this *Token) GetStringConfig(key string, defVal string) string
- func (this *Token) MakeAccessToken(claims map[string]string) (token string, err error)
- func (this *Token) MakeJWT() *jwt.JWT
- func (this *Token) MakeRefreshToken(claims map[string]string) (token string, err error)
- func (this *Token) MakeToken(claims map[string]string) (token string, err error)
- func (this *Token) ReadDataFromFile(file string) ([]byte, error)
- func (this *Token) SetConfig(key string, value any) *Token
- func (this *Token) WithClaim(key string, value any) *Token
- func (this *Token) WithConfig(configs ConfigMap) *Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Token ¶
type Token struct { // jwt JWT *jwt.JWT // 配置 Config ConfigMap // 载荷 Claims ClaimMap // contains filtered or unexported fields }
*
- 授权 *
- @create 2021-6-19
- @author deatil
func (*Token) ReadDataFromFile ¶
从文件读取数据
Click to show internal directories.
Click to hide internal directories.