Documentation ¶
Index ¶
- type IPermissionCache
- type ITokenCache
- type IUserCache
- type PermissionCache
- type TokenCache
- func (c *TokenCache) DeleteAllUserTokens(ctx context.Context, userIDs ...int) error
- func (c *TokenCache) DeleteTokenByUidPid(ctx context.Context, userID int, DeviceID int, fields []string) error
- func (c *TokenCache) GetTokensWithoutError(ctx context.Context, userID int, DeviceID int) (map[string]int, error)
- func (c *TokenCache) SetTokenFlag(ctx context.Context, userID int, DeviceID int, token string, flag int) error
- func (c *TokenCache) SetTokenFlagEx(ctx context.Context, userID int, DeviceID int, token string, flag int) error
- func (c *TokenCache) SetTokenMapByUidPid(ctx context.Context, userID int, DeviceID int, m map[string]int) error
- type UserCache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IPermissionCache ¶ added in v2.0.4
type IPermissionCache interface { cache.BatchDeleter GetPermissionList(ctx context.Context, fn func(ctx context.Context) ([]model.Permission, error)) (list []model.Permission, err error) DelPermissionList() IPermissionCache }
func NewPermissionCache ¶ added in v2.0.4
func NewPermissionCache(rdb redis.UniversalClient, rcClient *rockscache.Client, batchHandler cache.BatchDeleter) IPermissionCache
type ITokenCache ¶
type ITokenCache interface { SetTokenFlag(ctx context.Context, userID int, DeviceID int, token string, flag int) error SetTokenFlagEx(ctx context.Context, userID int, DeviceID int, token string, flag int) error GetTokensWithoutError(ctx context.Context, userID int, DeviceID int) (map[string]int, error) SetTokenMapByUidPid(ctx context.Context, userID int, DeviceID int, m map[string]int) error DeleteTokenByUidPid(ctx context.Context, userID int, DeviceID int, fields []string) error DeleteAllUserTokens(ctx context.Context, userIDs ...int) error }
func NewTokenCache ¶
func NewTokenCache(rdb redis.UniversalClient, accessExpire time.Duration) ITokenCache
type IUserCache ¶
type IUserCache interface { cache.BatchDeleter GetUserInfo(ctx context.Context, userID int, fn func(ctx context.Context) (*model.User, error)) (userInfo *model.User, err error) DelUsersInfo(userIDs ...int) IUserCache }
func NewUserCache ¶
func NewUserCache(rdb redis.UniversalClient, rcClient *rockscache.Client, batchHandler cache.BatchDeleter, accessExpire time.Duration) IUserCache
type PermissionCache ¶ added in v2.0.4
type PermissionCache struct { cache.BatchDeleter // contains filtered or unexported fields }
func (*PermissionCache) ClonePermissionCache ¶ added in v2.0.4
func (u *PermissionCache) ClonePermissionCache() IPermissionCache
func (*PermissionCache) DelPermissionList ¶ added in v2.0.4
func (u *PermissionCache) DelPermissionList() IPermissionCache
func (*PermissionCache) GetPermissionList ¶ added in v2.0.4
func (u *PermissionCache) GetPermissionList(ctx context.Context, fn func(ctx context.Context) ([]model.Permission, error)) (list []model.Permission, err error)
type TokenCache ¶
type TokenCache struct {
// contains filtered or unexported fields
}
func (*TokenCache) DeleteAllUserTokens ¶ added in v2.0.4
func (c *TokenCache) DeleteAllUserTokens(ctx context.Context, userIDs ...int) error
func (*TokenCache) DeleteTokenByUidPid ¶
func (*TokenCache) GetTokensWithoutError ¶
func (*TokenCache) SetTokenFlag ¶
func (*TokenCache) SetTokenFlagEx ¶
func (c *TokenCache) SetTokenFlagEx(ctx context.Context, userID int, DeviceID int, token string, flag int) error
SetTokenFlagEx set token and flag with expire time
func (*TokenCache) SetTokenMapByUidPid ¶
type UserCache ¶
type UserCache struct { cache.BatchDeleter // contains filtered or unexported fields }
func (*UserCache) CloneUserCache ¶
func (u *UserCache) CloneUserCache() IUserCache
func (*UserCache) DelUsersInfo ¶
func (u *UserCache) DelUsersInfo(userIDs ...int) IUserCache
Click to show internal directories.
Click to hide internal directories.