redis

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	// Key 键
	Key string
	// Value 值
	Value interface{}
	// Expiration 过期时间
	Expiration time.Duration
	// Compress 是否压缩
	Compress bool
}

Data 数据

type Redis

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

Redis 单例

func GetInstance

func GetInstance() *Redis

GetInstance 获取配置实例

func (*Redis) AsyncSet

func (o *Redis) AsyncSet(data *Data) error

AsyncSet 异步设置

func (*Redis) Del

func (o *Redis) Del(key string) error

Del 删除

func (*Redis) Get

func (o *Redis) Get(key string) (string, error)

Get 获取

func (*Redis) NewPool

func (o *Redis) NewPool() *ants.PoolWithFunc

NewPool 工作池

func (*Redis) Set

func (o *Redis) Set(key string, value interface{}, expiration time.Duration) error

Set 设置

Jump to

Keyboard shortcuts

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