cache

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheDB *redis.Client

Functions

func GetRedisClientPool

func GetRedisClientPool(db int) *redis.Client

Types

type Option

type Option func(*option)

func WithTrace

func WithTrace(t Trace) Option

WithTrace 设置trace信息

type Repo

type Repo interface {
	Set(key, value string, ttl time.Duration, options ...Option) error
	Get(key string, options ...Option) (string, error)
	TTL(key string) (time.Duration, error)
	Expire(key string, ttl time.Duration) bool
	ExpireAt(key string, ttl time.Time) bool
	Del(key string, options ...Option) bool
	Exists(keys ...string) bool
	Incr(key string, options ...Option) int64
	Close() error
	// contains filtered or unexported methods
}

func New

func New() (Repo, error)

type Trace

type Trace = trace.T

Jump to

Keyboard shortcuts

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