Documentation ¶
Index ¶
- func AddTokenTOBlacklist(ctx context.Context, token string, expiration time.Duration) error
- func AddUserToken(ctx context.Context, token string, userId string, expiration time.Duration) error
- func CheckTenantDynamicToken(ctx context.Context, appId string, token string) bool
- func CheckTokenInBlack(ctx context.Context, token string) bool
- func CheckUserToken(ctx context.Context, token string, userId string) bool
- func CheckUserVerificationCode(ctx context.Context, vo *UserVerificationCodeVo) bool
- func NewRedisCache(op *Option)
- func SetTenantDynamicToken(ctx context.Context, appId string, token string) error
- func SetUserLoginCode(ctx context.Context, vo *UserVerificationCodeVo) error
- func SetUserResetPasswordCode(ctx context.Context, vo *UserVerificationCodeVo) error
- func SetUserVerificationCode(ctx context.Context, vo *UserVerificationCodeVo) error
- type Option
- type UserVerificationCodeVo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddTokenTOBlacklist ¶
将 token 加入到黑名单
func AddUserToken ¶
func CheckTenantDynamicToken ¶
每次取用都延期,
func CheckTokenInBlack ¶
检查token 是否在黑名单中
func CheckUserVerificationCode ¶
func CheckUserVerificationCode(ctx context.Context, vo *UserVerificationCodeVo) bool
校验验证码 验证码正常校验之后就要删除
func NewRedisCache ¶
func NewRedisCache(op *Option)
func SetTenantDynamicToken ¶
租户的动态token 有效期只有20分钟 主要用于接口调试,过期了就要重新搞
func SetUserLoginCode ¶
func SetUserLoginCode(ctx context.Context, vo *UserVerificationCodeVo) error
func SetUserResetPasswordCode ¶
func SetUserResetPasswordCode(ctx context.Context, vo *UserVerificationCodeVo) error
func SetUserVerificationCode ¶
func SetUserVerificationCode(ctx context.Context, vo *UserVerificationCodeVo) error
将验证码写入redis 默认有效时间为5分钟
Types ¶
type Option ¶
type Option struct { Addr string `mapstructure:"addr" json:"addr" yaml:"addr" ` DB int `mapstructure:"db" json:"db" yaml:"db" ` UserName string `mapstructure:"user-name" json:"user-name" yaml:"user-name" ` Password string `mapstructure:"password" json:"password" yaml:"password" ` EnableCluster bool `mapstructure:"is-cluster" json:"is-cluster" yaml:"is-cluster" ` Addrs []string `mapstructure:"addrs" json:"addrs" yaml:"addrs" ` MasterName string `mapstructure:"master-name" json:"master-name" yaml:"master-name" ` MaxIdle int `mapstructure:"max-idle" json:"max-idle" yaml:"max-idle" ` MaxActive int `mapstructure:"max-active" json:"max-active" yaml:"max-active" ` Timeout int `mapstructure:"timeout" json:"timeout" yaml:"timeout" ` UseSSL bool `mapstructure:"use-ssl" json:"use-ssl" yaml:"use-ssl" ` SSLInsecureSkipVerify bool `mapstructure:"ssl-insecure-skip-verify" json:"ssl-insecure-skip-verify" yaml:"ssl-insecure-skip-verify" ` }
type UserVerificationCodeVo ¶
func (*UserVerificationCodeVo) GetKey ¶
func (u *UserVerificationCodeVo) GetKey() string
Click to show internal directories.
Click to hide internal directories.