rds

package
v0.0.0-...-5859b4f Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

*

  • Created by IDEA.
  • User: godsoul

*

  • Created by IDEA.
  • User: godsoul

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rds

type Rds struct {
	Con redis.Conn
}

对常用命令的二次封装

func (*Rds) BLPOP

func (r *Rds) BLPOP(key string, d int) []string

d 阻塞时间,单位秒

func (*Rds) Close

func (r *Rds) Close()

func (*Rds) Del

func (r *Rds) Del(k string) error

func (*Rds) Exists

func (r *Rds) Exists(k string) bool

func (*Rds) Expire

func (r *Rds) Expire(k string, d int) error

func (*Rds) Get

func (r *Rds) Get(k string) (string, error)

func (*Rds) GetHashList

func (r *Rds) GetHashList(keys map[string][]string) (map[string]map[string]interface{}, error)

func (*Rds) HGet

func (r *Rds) HGet(key, field string) (interface{}, error)

func (*Rds) HGetAll

func (r *Rds) HGetAll(key string) map[string]string

func (*Rds) HINCRBY

func (r *Rds) HINCRBY(key, field string, value int) (int, error)

func (*Rds) HMGet

func (r *Rds) HMGet(key string, args ...string) ([]interface{}, error)

func (*Rds) HMSet

func (r *Rds) HMSet(key string, args interface{}) error

func (*Rds) HSet

func (r *Rds) HSet(key, field string, value interface{}) error

func (*Rds) Incr

func (r *Rds) Incr(key string) (int, error)

func (*Rds) LPOP

func (r *Rds) LPOP(key string) (interface{}, error)

func (*Rds) LPush

func (r *Rds) LPush(key, value string) error

func (*Rds) LRange

func (r *Rds) LRange(key string, begin, end int) ([]interface{}, error)

func (*Rds) Map2Struct

func (r *Rds) Map2Struct(key string, obj interface{}) error

func (*Rds) RPush

func (r *Rds) RPush(key, value string) error

func (*Rds) SAdd

func (r *Rds) SAdd(key, value string) error

func (*Rds) SCard

func (r *Rds) SCard(key string) (int, error)

func (*Rds) SMembers_Ints

func (r *Rds) SMembers_Ints(key string) ([]int, error)

func (*Rds) SMembers_Strings

func (r *Rds) SMembers_Strings(key string) ([]string, error)

func (*Rds) SREM

func (r *Rds) SREM(key, value string) error

func (*Rds) Scard

func (r *Rds) Scard(key string) int

func (*Rds) Set

func (r *Rds) Set(k string, v interface{}) error

func (*Rds) SetEx

func (r *Rds) SetEx(k string, exp int, v interface{}) error

注意这里的参数顺序

func (*Rds) SisMember

func (r *Rds) SisMember(key string, m int) (bool, error)

func (*Rds) ZAdd

func (r *Rds) ZAdd(key string, score interface{}, member string) error

func (*Rds) ZCard

func (r *Rds) ZCard(key string) (int, error)

func (*Rds) ZRANGEBYSCORE

func (r *Rds) ZRANGEBYSCORE(key, min, max string, offset, count int) ([]interface{}, error)

func (*Rds) ZREM

func (r *Rds) ZREM(key, value string) error

func (*Rds) ZREVRANK

func (r *Rds) ZREVRANK(key string, s int) (int, error)

type RdsPool

type RdsPool struct {
	Host      string
	Port      string
	Password  string
	Maxidle   int
	Maxactive int
	// contains filtered or unexported fields
}

func NewRdsPool

func NewRdsPool(host, port, password string, maxidle, maxactive int) *RdsPool

func (*RdsPool) Get

func (pool *RdsPool) Get() Rds

Jump to

Keyboard shortcuts

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