redis

package
v0.0.0-...-18c487f Latest Latest
Warning

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

Go to latest
Published: May 17, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Del

func Del(key string) (int, error)

删除指定key

func Do

func Do(cmd string, args ...interface{}) (interface{}, error)

func Exist

func Exist(key string) (int, error)

删除指定key

func GetRedis

func GetRedis() redis.Conn

获取redis连接

func ScanStruct

func ScanStruct(src []interface{}, dest interface{}) error

转换成struct

func Send

func Send(cmd string, args ...interface{}) error

func SetPool

func SetPool(netType, server, password string, dbIndex, maxIdle, maxActive, idleTimeout int)

Types

type Hash

type Hash struct {
	Name string
}

func NewHash

func NewHash(name string) *Hash

func (*Hash) Clear

func (this *Hash) Clear() error

func (*Hash) Exists

func (this *Hash) Exists(k string) bool

func (*Hash) Get

func (this *Hash) Get(k string) (string, error)

func (*Hash) GetObject

func (this *Hash) GetObject(k string, clazz interface{}) error

func (*Hash) GetString

func (this *Hash) GetString(k string) (string, error)

func (*Hash) GetStringList

func (this *Hash) GetStringList(k []string) ([]string, error)

func (*Hash) HgetAll

func (this *Hash) HgetAll() ([]interface{}, error)

根据key获取所有

func (*Hash) MultiGet

func (this *Hash) MultiGet(k []string) ([]string, error)

func (*Hash) Put

func (this *Hash) Put(k, v string) error

func (*Hash) PutObject

func (this *Hash) PutObject(k string, v interface{}) error

func (*Hash) PutString

func (this *Hash) PutString(k string, v string) error

func (*Hash) Remove

func (this *Hash) Remove(k string) error

func (*Hash) SetExpire

func (this *Hash) SetExpire(second int) error

func (*Hash) Size

func (this *Hash) Size() (int, error)

type RedisPool

type RedisPool struct {
	*redis.Pool
}

Jump to

Keyboard shortcuts

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