redix

package
v0.0.0-...-13c8884 Latest Latest
Warning

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

Go to latest
Published: May 5, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

redis常用接口封装

redis客户端封装(github.com/mediocregopher/radix.v2)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lock

func Lock(pool Pool, key string, lockSec int) bool

locker

func NewCluster

func NewCluster(addr, pwd string, maxIdle int) (*cluster.Cluster, error)

cluster

func NewPool

func NewPool(addr, pwd string, maxIdle int) (*pool.Pool, error)

redis pool

func Unlock

func Unlock(pool Pool, key string)

Types

type Config

type Config struct {
	Addr    string // 10.38.164.197:6379
	Pwd     string // 密码
	MaxIdle int    // 最大空闲连接
	Cluster bool   // 是否为cluster. true=cluster, false=普通
}

type Pool

type Pool interface {
	Cmd(cmd string, args ...interface{}) *redis.Resp
}

func New

func New(cfg *Config) (Pool, error)

Jump to

Keyboard shortcuts

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