gredis

package
v1.0.898 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Redis客户端. Redis中文手册文档请参考:http://redisdoc.com/ ,Redis官方命令请参考:https://redis.io/commands

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host string // IP/域名
	Port int    // 端口
	Db   int    // db
	Pass string // 密码
}

Redis服务端但节点连接配置信息

type PoolStats

type PoolStats struct {
	redis.PoolStats
}

Redis链接池统计信息

type Redis

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

Redis客户端

func New

func New(config Config) *Redis

创建redis操作对象.

func (*Redis) Close

func (r *Redis) Close() error

关闭redis管理对象,将会关闭底层的

func (*Redis) Do

func (r *Redis) Do(command string, args ...interface{}) (interface{}, error)

执行同步命令 - Do

func (*Redis) Send

func (r *Redis) Send(command string, args ...interface{}) error

执行异步命令 - Send

func (*Redis) SetIdleTimeout

func (r *Redis) SetIdleTimeout(value time.Duration)

设置属性 - IdleTimeout

func (*Redis) SetMaxActive

func (r *Redis) SetMaxActive(value int)

设置属性 - MaxActive

func (*Redis) SetMaxConnLifetime

func (r *Redis) SetMaxConnLifetime(value time.Duration)

设置属性 - MaxConnLifetime

func (*Redis) SetMaxIdle

func (r *Redis) SetMaxIdle(value int)

设置属性 - MaxIdle

func (*Redis) Stats

func (r *Redis) Stats() *PoolStats

获取当前连接池统计信息

Jump to

Keyboard shortcuts

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