Documentation ¶
Index ¶
- Constants
- Variables
- 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 RefreshTokenStore
- type RefreshTokenStorePoint
- 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 UserOperationIDChannel
- type UserOperationIDInfo
Constants ¶
View Source
const Nil = redis.Nil
Variables ¶
View Source
var AppCode = AppCodeHelper{ // contains filtered or unexported fields }
View Source
var Client *redis.Client
View Source
var NewMfaLogin = tokenStore.NewTokenStoreFactory[jwtClaims.MfaRedis](keyUserMfaLogin.String(), func() *redis.Client { return Client })
View Source
var NewThirdPartyLogin = tokenStore.NewTokenStoreFactory[jwtClaims.LoginRedis](keyThirdPartyLogin.String(), func() *redis.Client { return Client })
View Source
var NewU2F = tokenStore.NewTokenStoreFactory[types.Nil](keyU2F.String(), func() *redis.Client { return Client })
Functions ¶
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 (token 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 (channel CanceledTokenChannel) Publish(ctx context.Context, token CanceledToken) error
func (CanceledTokenChannel) Subscribe ¶ added in v1.19.8
func (channel 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 (table CanceledTokenTable) Add(ctx context.Context, tokens ...CanceledToken) error
func (CanceledTokenTable) Get ¶ added in v1.19.8
func (table 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 RefreshTokenStore ¶ added in v1.19.18
type RefreshTokenStore struct { tokenStore.TokenStore[types.Nil] }
func NewRecordedToken ¶ added in v1.17.36
func NewRecordedToken() RefreshTokenStore
func (RefreshTokenStore) NewStorePoint ¶ added in v1.19.18
func (store RefreshTokenStore) NewStorePoint(id uint64) RefreshTokenStorePoint
type RefreshTokenStorePoint ¶ added in v1.19.18
type RefreshTokenStorePoint struct { tokenStore.Point[types.Nil] // contains filtered or unexported fields }
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) GetOperationTable ¶ added in v1.19.19
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 UserOperationIDChannel ¶ added in v1.19.19
type UserOperationIDChannel struct {
// contains filtered or unexported fields
}
func NewUserOperationIDChannel ¶ added in v1.19.19
func NewUserOperationIDChannel() UserOperationIDChannel
func (UserOperationIDChannel) Publish ¶ added in v1.19.19
func (channel UserOperationIDChannel) Publish(ctx context.Context, info UserOperationIDInfo) error
func (UserOperationIDChannel) Subscribe ¶ added in v1.19.19
func (channel UserOperationIDChannel) Subscribe(ctx context.Context) *redis.PubSub
type UserOperationIDInfo ¶ added in v1.19.19
Click to show internal directories.
Click to hide internal directories.