rediscli

package
v0.0.0-...-8669a18 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Copyright 2017 gopool Author. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

redis client

Index

Constants

View Source
const (
	DEFAULT_ADDR         = "127.0.0.1:6379"
	DEFAULT_SIZE         = 100
	DEFAULT_CONNTIMEOUT  = 100
	DEFAULT_READTIMEOUT  = 50
	DEFAULT_WRITETIMEOUT = 50
	DEFAULT_MAXQPS       = 100000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisCli

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

func NewRedisCli

func NewRedisCli(req *Req) (rc *RedisCli, err error)

func (*RedisCli) Del

func (rc *RedisCli) Del(key string) (err error)

func (*RedisCli) Exists

func (rc *RedisCli) Exists(key string) (ex bool, err error)

func (*RedisCli) Expire

func (rc *RedisCli) Expire(key string, expiresecond int) (err error)

func (*RedisCli) FlushAll

func (rc *RedisCli) FlushAll() (err error)

func (*RedisCli) Get

func (rc *RedisCli) Get(key string) (reply string, err error)

func (*RedisCli) GetConnAllCount

func (rc *RedisCli) GetConnAllCount() int

func (*RedisCli) GetConnCount

func (rc *RedisCli) GetConnCount() map[string]int

func (*RedisCli) GetHealthy

func (rc *RedisCli) GetHealthy() map[string]bool

func (*RedisCli) GetUnhealthyNodeCount

func (rc *RedisCli) GetUnhealthyNodeCount() (int, []string)

func (*RedisCli) HDel

func (rc *RedisCli) HDel(key string, fields ...interface{}) (reply int64, err error)

func (*RedisCli) HGet

func (rc *RedisCli) HGet(key, subkey string) (reply string, err error)

func (*RedisCli) HGetall

func (rc *RedisCli) HGetall(key string) (reply map[string]string, err error)

func (*RedisCli) HKeys

func (rc *RedisCli) HKeys(key string) (replys []string, err error)

func (*RedisCli) HMGet

func (rc *RedisCli) HMGet(key string, fields []interface{}) (replys []string, err error)

func (*RedisCli) HMSet

func (rc *RedisCli) HMSet(key string, values []interface{}) (err error)

func (*RedisCli) HSet

func (rc *RedisCli) HSet(key, subkey, value string) (err error)

func (*RedisCli) Incr

func (rc *RedisCli) Incr(key string) (reply int, err error)

func (*RedisCli) IncrBy

func (rc *RedisCli) IncrBy(key string, value int) (reply int, err error)

func (*RedisCli) IncrByfloat

func (rc *RedisCli) IncrByfloat(key string, value float64) (reply string, err error)

func (*RedisCli) MGet

func (rc *RedisCli) MGet(keys ...interface{}) (replys []string, err error)

func (*RedisCli) SAdd

func (rc *RedisCli) SAdd(key string, args ...interface{}) (err error)

func (*RedisCli) SCard

func (rc *RedisCli) SCard(key string) (reply int, err error)

func (*RedisCli) SMembers

func (rc *RedisCli) SMembers(key string) (reply []string, err error)

func (*RedisCli) SPop

func (rc *RedisCli) SPop(key string) (reply string, err error)

func (*RedisCli) SRem

func (rc *RedisCli) SRem(key string, args ...interface{}) (err error)

func (*RedisCli) SUnionstore

func (rc *RedisCli) SUnionstore(dkey string, args ...interface{}) (count int64, err error)

func (*RedisCli) Set

func (rc *RedisCli) Set(args ...interface{}) (err error)

func (*RedisCli) Setnx

func (rc *RedisCli) Setnx(key, value string) (err error)

func (*RedisCli) TTL

func (rc *RedisCli) TTL(key string) (reply int, err error)

func (*RedisCli) ZAdd

func (rc *RedisCli) ZAdd(key string, ttl int64, args ...interface{}) (err error)

ZADD key score member [[score member] [score member] ...]

func (*RedisCli) ZCount

func (rc *RedisCli) ZCount(key string, min, max int64) (reply int64, err error)

func (*RedisCli) ZRange

func (rc *RedisCli) ZRange(key string, start, stop int) (reply []string, err error)

func (*RedisCli) ZRangeByScore

func (rc *RedisCli) ZRangeByScore(key string, min, max int, minopen, maxopen bool) (reply []string, err error)

func (*RedisCli) ZRangeByScoreWithScores

func (rc *RedisCli) ZRangeByScoreWithScores(key string, min, max int, minopen, maxopen bool) (reply map[string]string, err error)

func (*RedisCli) ZRangeWithScores

func (rc *RedisCli) ZRangeWithScores(key string, start, stop int) (reply map[string]string, err error)

func (*RedisCli) ZRem

func (rc *RedisCli) ZRem(keys ...interface{}) (reply int64, err error)

func (*RedisCli) ZRemRangeByScore

func (rc *RedisCli) ZRemRangeByScore(key string, min, max int64) (reply int64, err error)

func (*RedisCli) ZScore

func (rc *RedisCli) ZScore(key, val string) (score int64, err error)

type Req

type Req struct {
	Addrs        []string
	Size         int
	ConnTimeOut  int64
	ReadTimeOut  int64
	WriteTimeOut int64
	MaxQps       int64
}

func (*Req) GetAddrs

func (req *Req) GetAddrs() []string

func (*Req) GetConnTimeOut

func (req *Req) GetConnTimeOut() int64

func (*Req) GetMaxQps

func (req *Req) GetMaxQps() int64

func (*Req) GetReadTimeOut

func (req *Req) GetReadTimeOut() int64

func (*Req) GetSize

func (req *Req) GetSize() int

func (*Req) GetWriteTimeOut

func (req *Req) GetWriteTimeOut() int64

Jump to

Keyboard shortcuts

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