Documentation ¶
Index ¶
- Constants
- Variables
- func NewMfaLogin() tokenStore.TokenStore[jwtClaims.MfaRedis]
- func NewRefreshToken() tokenStore.TokenStore[types.Nil]
- func NewThirdPartyLogin() tokenStore.TokenStore[jwtClaims.LoginRedis]
- func NewU2F() tokenStore.TokenStore[types.Nil]
- func PublishSshDev(messages []rpcModel.SshAccountMsg) error
- func SubScribeSshDev() *redis.PubSub
- type AppCodeHelper
- type AppKeyPair
- type MfaEnable
- type Passkey
- type Sms
- type SyncStat
- func (a *SyncStat) Inject(schedule cron.Schedule, f func() error) func() error
- func (a *SyncStat) SetSuccess(ctx context.Context, expire time.Duration) error
- func (a *SyncStat) ShouldLock(ctx context.Context, expire time.Duration) (bool, error)
- func (a *SyncStat) Succeed(ctx context.Context) (bool, error)
- func (a *SyncStat) TryLock(ctx context.Context, expire time.Duration) (bool, error)
- func (a *SyncStat) Unlock(ctx context.Context) error
- type UserIdentityCode
- type UserJwt
- type UserJwtOperator
- func (u UserJwtOperator) ChangeOperateID(ctx context.Context) (uint64, error)
- func (u UserJwtOperator) CheckOperateID(ctx context.Context, oid uint64) (bool, error)
- func (u UserJwtOperator) Create(ctx context.Context) error
- func (u UserJwtOperator) Del(ctx context.Context) error
- func (u UserJwtOperator) Exist(ctx context.Context) (bool, error)
- func (u UserJwtOperator) GetOperateID(ctx context.Context) (uint64, error)
- type UserPasskey
Constants ¶
View Source
const Nil = redis.Nil
Variables ¶
View Source
var AppCode = AppCodeHelper{ // contains filtered or unexported fields }
View Source
var Client *redis.Client
Functions ¶
func NewMfaLogin ¶
func NewMfaLogin() tokenStore.TokenStore[jwtClaims.MfaRedis]
func NewRefreshToken ¶ added in v1.17.8
func NewRefreshToken() tokenStore.TokenStore[types.Nil]
func NewThirdPartyLogin ¶
func NewThirdPartyLogin() tokenStore.TokenStore[jwtClaims.LoginRedis]
func NewU2F ¶
func NewU2F() tokenStore.TokenStore[types.Nil]
func PublishSshDev ¶ added in v1.16.14
func PublishSshDev(messages []rpcModel.SshAccountMsg) error
func SubScribeSshDev ¶ added in v1.16.14
func SubScribeSshDev() *redis.PubSub
Types ¶
type AppCodeHelper ¶
type AppCodeHelper struct {
// contains filtered or unexported fields
}
func (AppCodeHelper) Add ¶
func (a AppCodeHelper) Add(data ...string) error
Add Deprecated: use service.App.AddAppCodeToRedis instead
func (AppCodeHelper) Del ¶
func (a AppCodeHelper) Del(data ...string) error
func (AppCodeHelper) Exist ¶
func (a AppCodeHelper) Exist(data string) (bool, error)
Exist Deprecated: use service.App.AppCodeExist instead
func (AppCodeHelper) IsEmpty ¶
func (a AppCodeHelper) IsEmpty() (bool, error)
func (AppCodeHelper) Load ¶
func (a AppCodeHelper) Load() ([]string, error)
type AppKeyPair ¶ added in v1.17.9
type AppKeyPair struct {
// contains filtered or unexported fields
}
func NewAppKeyPair ¶ added in v1.17.9
func NewAppKeyPair(appCode string) AppKeyPair
type MfaEnable ¶
type MfaEnable struct {
// contains filtered or unexported fields
}
func NewMfaEnable ¶
type Passkey ¶
type Passkey struct {
// contains filtered or unexported fields
}
func NewPasskey ¶
func (Passkey) NewUser ¶
func (p Passkey) NewUser(id uint) UserPasskey
func (Passkey) ReadSession ¶
ReadSession 读取后自动销毁
type SyncStat ¶
type SyncStat struct {
// contains filtered or unexported fields
}
func NewSyncStat ¶
func (*SyncStat) SetSuccess ¶
func (*SyncStat) ShouldLock ¶
type UserIdentityCode ¶
type UserIdentityCode struct {
// contains filtered or unexported fields
}
func NewUserIdentityCode ¶
func NewUserIdentityCode(uid uint) UserIdentityCode
func (UserIdentityCode) Destroy ¶
func (a UserIdentityCode) Destroy() error
func (UserIdentityCode) New ¶
func (a UserIdentityCode) New() (string, error)
New 新建身份校验码,五分钟有效,每用户仅存在一个
func (UserIdentityCode) VerifyAndDestroy ¶
func (a UserIdentityCode) VerifyAndDestroy(code string) (bool, error)
VerifyAndDestroy 校验并销毁 code
type UserJwt ¶
type UserJwt struct {
// contains filtered or unexported fields
}
func (UserJwt) NewOperator ¶ added in v1.17.7
func (u UserJwt) NewOperator(uid uint) UserJwtOperator
type UserJwtOperator ¶ added in v1.17.7
type UserJwtOperator struct {
// contains filtered or unexported fields
}
func (UserJwtOperator) ChangeOperateID ¶ added in v1.17.7
func (u UserJwtOperator) ChangeOperateID(ctx context.Context) (uint64, error)
func (UserJwtOperator) CheckOperateID ¶ added in v1.17.7
func (UserJwtOperator) Create ¶ added in v1.17.7
func (u UserJwtOperator) Create(ctx context.Context) error
func (UserJwtOperator) Del ¶ added in v1.17.7
func (u UserJwtOperator) Del(ctx context.Context) error
func (UserJwtOperator) Exist ¶ added in v1.17.7
func (u UserJwtOperator) Exist(ctx context.Context) (bool, error)
func (UserJwtOperator) GetOperateID ¶ added in v1.17.7
func (u UserJwtOperator) GetOperateID(ctx context.Context) (uint64, error)
type UserPasskey ¶
type UserPasskey struct {
// contains filtered or unexported fields
}
func (UserPasskey) ReadSession ¶
func (u UserPasskey) ReadSession(ctx context.Context, session any) error
func (UserPasskey) StoreSession ¶
Click to show internal directories.
Click to hide internal directories.