rcache

package
v0.0.0-...-6a53fb6 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2021 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CacheCategoryInMem = true
)
View Source
var (
	ErrCannotDecode = errors.New("cannot decode the session in redis")
)

Functions

This section is empty.

Types

type RCache

type RCache struct {
	// contains filtered or unexported fields
}

func New

func New(opt *redis.Options, ttl *TTLConfig, storage storage.Provider) (*RCache, error)

func (*RCache) CategoryByTName

func (r *RCache) CategoryByTName(tname string) (*category.Category, bool, error)

func (*RCache) Close

func (r *RCache) Close() error

func (*RCache) FlushAll

func (r *RCache) FlushAll() error

func (*RCache) Ping

func (r *RCache) Ping() (string, error)

func (*RCache) RedisClient

func (r *RCache) RedisClient() *redis.Client

func (*RCache) RefreshCategory

func (r *RCache) RefreshCategory() error

func (*RCache) RefreshUserBasicByUID

func (r *RCache) RefreshUserBasicByUID(uid int32) (*user.Basic, error)

func (*RCache) RefreshUserUIDByUsername

func (r *RCache) RefreshUserUIDByUsername(username string) (int32, error)

func (*RCache) RefreshValidSessionByToken

func (r *RCache) RefreshValidSessionByToken(token string) (*session.Cache, error)

func (*RCache) UserBasicByUID

func (r *RCache) UserBasicByUID(uid int32) (*user.Basic, bool, error)

func (*RCache) UserUIDByUsername

func (r *RCache) UserUIDByUsername(username string) (int32, bool, error)

func (*RCache) ValidSessionByToken

func (r *RCache) ValidSessionByToken(token string) (*session.Cache, bool, error)

type TTLConfig

type TTLConfig struct {
	UserBasic time.Duration
	UserUID   time.Duration
	Category  time.Duration
	Session   time.Duration
}

Jump to

Keyboard shortcuts

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