redisPool

package
v2.20.3 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 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 RedisPool

type RedisPool struct {
	// contains filtered or unexported fields
}
var (
	RedisPoolApp RedisPool
)

func (*RedisPool) Clean added in v2.11.1

func (*RedisPool) Clean()

Clean 清理链接

func (*RedisPool) Close added in v2.11.1

func (mine *RedisPool) Close(key string) error

Close 关闭链接

func (*RedisPool) Get

func (*RedisPool) Get(clientName, key string) (string, error)

Get 获取值

func (*RedisPool) GetClient added in v2.12.0

func (*RedisPool) GetClient(key string) (string, *redis.Client)

GetClient 获取链接和链接前缀

func (*RedisPool) Once

func (*RedisPool) Once(redisSetting *RedisSetting) *RedisPool

Once 单例化:redis 链接

func (*RedisPool) Set added in v2.12.0

func (*RedisPool) Set(clientName, key string, val any, exp time.Duration) (string, error)

Set 设置值

type RedisSetting

type RedisSetting struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	Password string `yaml:"password"`
	Prefix   string `yaml:"prefix"`
	Pool     []struct {
		Key    string `yaml:"key"`
		Prefix string `yaml:"prefix"`
		DbNum  int    `yaml:"dbNum"`
	}
}
var RedisSet RedisSetting

func (RedisSetting) ExampleYaml added in v2.11.2

func (RedisSetting) ExampleYaml() string

ExampleYaml 示例配置文件

func (RedisSetting) New

func (RedisSetting) New(path string) *RedisSetting

New 初始化:数据库配置

Jump to

Keyboard shortcuts

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