redis

package
v0.0.0-...-479da69 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExampleUsage

func ExampleUsage()

ExampleUsage 使用示例

@see https://github.com/go-redis/redis

func GetInstance

func GetInstance() *redisLib.Client

GetInstance 获取redis连接实例

func InitRedis

func InitRedis(opts OptionsFields)

InitRedis 初始化redis连接

Types

type Conf

type Conf struct {
	Host     string `yaml:"host" toml:"host" json:"host" default:"localhost"` //主机地址
	Port     int    `yaml:"port" toml:"port" json:"port" default:"6379"`      //端口
	Password string `yaml:"password" toml:"password" json:"password"`         //密码
	Database int    `yaml:"database" toml:"database" json:"database"`         //数据库名
}

Conf 配置信息

type OptionsFields

type OptionsFields struct {
	Host     string //主机地址
	Port     int    //端口
	Password string //密码
	Database int    //库序号
}

OptionsFields 配置项字段

Jump to

Keyboard shortcuts

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