cache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Local

func Local() local_cache.Cache

func Redis

func Redis(driver ...string) *redis.Client

func RedisDel

func RedisDel(key string)

func RedisHasOrQuery

func RedisHasOrQuery(key string, queryFunc func() (data string, exp time.Duration)) string

func RedisHasOrQueryByte

func RedisHasOrQueryByte(key string, queryFunc func() (data []byte, exp time.Duration)) []byte

func RedisHasOrQuerySerializerGob

func RedisHasOrQuerySerializerGob[T any](key string, resultReceiver *T, queryFunc func(*T) (expirationTime time.Duration, err error)) error

func RedisStrGet

func RedisStrGet(key string) string

func RedisStrSet

func RedisStrSet(key, value string, exp time.Duration)

Types

type Base64CaptchaStore

type Base64CaptchaStore struct {
}

TODO 验证码使用本地缓存,在多机部署时会存在问题

func (Base64CaptchaStore) Get

func (b Base64CaptchaStore) Get(id string, clear bool) string

func (Base64CaptchaStore) Set

func (b Base64CaptchaStore) Set(id string, value string) error

func (Base64CaptchaStore) Verify

func (b Base64CaptchaStore) Verify(id string, answer string, clear bool) bool

Jump to

Keyboard shortcuts

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