cache

package
v2.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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 (c *TokenCache) DeleteTokenByUidPid(ctx context.Context, userID int, DeviceID int, fields []string) error

func (*TokenCache) GetTokensWithoutError

func (c *TokenCache) GetTokensWithoutError(ctx context.Context, userID int, DeviceID int) (map[string]int, error)

func (*TokenCache) SetTokenFlag

func (c *TokenCache) SetTokenFlag(ctx context.Context, userID int, DeviceID int, token string, flag int) error

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

func (c *TokenCache) SetTokenMapByUidPid(ctx context.Context, userID int, DeviceID int, m map[string]int) error

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

func (*UserCache) GetUserInfo

func (u *UserCache) GetUserInfo(ctx context.Context, userID int, fn func(ctx context.Context) (*model.User, error)) (userInfo *model.User, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL