redis

package
v1.0.1005 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr     string
	Password string
	DB       int

	MinIdleConn  int
	DialTimeout  time.Duration
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
	PoolSize     int
	PoolTimeout  time.Duration

	EnableTrace bool

	KeyPrefix string

	Logger iLogger
}

缓存配置

type Redis

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

*

  • redis 缓存 *
  • @create 2021-9-8
  • @author deatil

func New

func New(config Config) Redis

构造函数

func (Redis) Check

func (this Redis) Check(keys ...string) (bool, error)

func (Redis) Close

func (this Redis) Close() error

func (Redis) Delete

func (this Redis) Delete(keys ...string) (bool, error)

func (Redis) Get

func (this Redis) Get(key string, value any) error

获取

func (Redis) GetClient

func (this Redis) GetClient() *redis.Client

func (Redis) Set

func (this Redis) Set(key string, value any, expiration any) error

设置

Jump to

Keyboard shortcuts

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