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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config Config) interfaces.Store

构造函数

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
	TTL       int

	Logger iLogger
}

缓存配置

type Redis

type Redis struct {
	// 继承默认
	store.Store
	// contains filtered or unexported fields
}

*

  • Redis 存储 *
  • @create 2021-10-18
  • @author deatil

func (*Redis) Get

func (this *Redis) Get(id string, clear bool) string

获取

func (*Redis) Set

func (this *Redis) Set(id string, value string) error

设置

func (*Redis) Verify

func (this *Redis) Verify(id, answer string, clear bool) bool

验证

Jump to

Keyboard shortcuts

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