Documentation ¶
Index ¶
- Constants
- Variables
- func CancelToken(ctx context.Context, id uint64, appCode string, validBefore time.Time) error
- func NewMfaLogin() tokenStore.TokenStore[jwtClaims.MfaRedis]
- func NewRecordedToken() tokenStore.TokenStore[types.Nil]
- func NewThirdPartyLogin() tokenStore.TokenStore[jwtClaims.LoginRedis]
- func NewU2F() tokenStore.TokenStore[types.Nil]
- func PublishSshDev(messages []sshDevModel.SshAccountMsg) error
- func SubscribeSshDev() *redis.PubSub
- type AppCodeHelper
- type AppKeyPair
- type CanceledToken
- type CanceledTokenChannel
- type CanceledTokenPayload
- type CanceledTokenTable
- type MfaEnable
- type Passkey
- type PasskeyNamespace
- 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)
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 CancelToken ¶ added in v1.19.8
func NewMfaLogin ¶
func NewMfaLogin() tokenStore.TokenStore[jwtClaims.MfaRedis]
func NewRecordedToken ¶ added in v1.17.36
func NewRecordedToken() 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 []sshDevModel.SshAccountMsg) error
func SubscribeSshDev ¶ added in v1.19.8
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 CanceledToken ¶ added in v1.19.8
type CanceledToken struct { ID uint64 `json:"id"` CanceledTokenPayload }
func (CanceledToken) Key ¶ added in v1.19.8
func (a CanceledToken) Key() string
type CanceledTokenChannel ¶ added in v1.19.8
type CanceledTokenChannel struct {
// contains filtered or unexported fields
}
func NewCanceledTokenChannel ¶ added in v1.19.8
func NewCanceledTokenChannel() CanceledTokenChannel
func (CanceledTokenChannel) Publish ¶ added in v1.19.8
func (a CanceledTokenChannel) Publish(ctx context.Context, token CanceledToken) error
func (CanceledTokenChannel) Subscribe ¶ added in v1.19.8
func (a CanceledTokenChannel) Subscribe(ctx context.Context) *redis.PubSub
type CanceledTokenPayload ¶ added in v1.19.9
type CanceledTokenTable ¶ added in v1.19.8
type CanceledTokenTable struct {
// contains filtered or unexported fields
}
func NewCanceledToken ¶ added in v1.19.8
func NewCanceledToken() CanceledTokenTable
func (CanceledTokenTable) Add ¶ added in v1.19.8
func (a CanceledTokenTable) Add(ctx context.Context, tokens ...CanceledToken) error
func (CanceledTokenTable) Get ¶ added in v1.19.8
func (a CanceledTokenTable) Get(ctx context.Context) ([]CanceledToken, error)
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 NewPasskey(ip string, namespace PasskeyNamespace, identity string) Passkey
func (Passkey) ReadSession ¶
ReadSession 读取后自动销毁
type PasskeyNamespace ¶ added in v1.17.64
type PasskeyNamespace string
const ( PasskeyUser PasskeyNamespace = "u" PasskeyUserRegister PasskeyNamespace = "ur" PasskeyLogin PasskeyNamespace = "l" )
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)
Click to show internal directories.
Click to hide internal directories.