Documentation ¶
Index ¶
- Constants
- Variables
- func EncryptPassword(password string) string
- func GenToken(ctx context.Context, field CustomField) (string, error)
- func GetDB() *gorm.DB
- func GetJwtFactory() *xjwt.JWTFactory
- func GetRedis() *redis.Client
- func InitGlobal() func()
- func InitJwtFactory(login xjwt.LoginFunc)
- func RefreshToken(ctx context.Context, token string) (string, error)
- func RegisteGlobalDB(db *gorm.DB)
- func RegisteGlobalRedis(client *redis.Client)
- func ResponseMsg(code int32) string
- func SetJwtFactory(jf *xjwt.JWTFactory)
- func ValidatePassword(password, encryptPassword string) bool
- type Claims
- type Config
- type CustomField
Constants ¶
View Source
const ( SuccessCode = 0 ErrorCode = 1 )
Variables ¶
View Source
var JWTExp string
View Source
var JWTKey string
Functions ¶
func EncryptPassword ¶
func GetJwtFactory ¶
func GetJwtFactory() *xjwt.JWTFactory
func InitJwtFactory ¶
func RegisteGlobalRedis ¶
RegisteGlobalRedis registe global redisClient
func ResponseMsg ¶
func SetJwtFactory ¶
func SetJwtFactory(jf *xjwt.JWTFactory)
func ValidatePassword ¶
Types ¶
type Claims ¶
type Claims struct { CustomField jwt.StandardClaims }
type Config ¶
func InitConfig ¶
func InitConfig() Config
type CustomField ¶
Click to show internal directories.
Click to hide internal directories.