redis_client

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisClient

type RedisClient struct {
	Conn redis.Conn
	Pool *redis.Pool
	// contains filtered or unexported fields
}

func (*RedisClient) Exec

func (e *RedisClient) Exec(command string, args ...interface{}) (any, error)

Exec 执行redis命令, 执行完成后连接自动放回连接池

func (*RedisClient) GetObject

func (e *RedisClient) GetObject(key string, ptr any) error

func (*RedisClient) InitRedis

func (e *RedisClient) InitRedis(
	masterName string, address string, password string, dbIds int, maxIdle int,
	maxActive int, connectTimeout int, readTimeout int, writeTimeout int,
)

func (*RedisClient) Set

func (e *RedisClient) Set(key string, val any) error

func (*RedisClient) SetEx

func (e *RedisClient) SetEx(key string, val any, expires int64) error

Jump to

Keyboard shortcuts

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