redis

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const FILEPATH = "redis_config"
View Source
const FILETYPE = "yaml"

Variables

This section is empty.

Functions

func ConnectRedis

func ConnectRedis(keyName, filePath, fileType string, DB int) *redis.Pool

纯粹的执行命令版本, 将一些命令进行了封装的包 https://github.com/go-redis/redis

func PoolInitRedis

func PoolInitRedis(config *Config) (*redis.Pool, error)

redis pool

Types

type Config

type Config struct {
	Name         string // redis name, for trace
	Proto        string // tcp
	Addr         string // "127.0.0.1:6379"
	Auth         string // passwd
	DB           int
	DialTimeout  time.Duration // 拨号超时
	ReadTimeout  time.Duration // 读取超时
	WriteTimeout time.Duration // 写入超时
}

Config client settings.

func InitReadConfig

func InitReadConfig(KeyName, FilePath, FileType string, DB int) *Config

Jump to

Keyboard shortcuts

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