redis

package
v0.0.0-...-480e040 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TCP                 = "tcp"
	ConnectTimeOut      = 60
	MaxRedisDatabase    = 16
	MaxRedisIdleSize    = 100
	MaxRedisActiveSize  = 0
	MaxRedisIdleTimeout = 60 * time.Second
	StatusSuccess       = "Success"
	StatusFailed        = "Failed"
)
View Source
const (
	Redis_PING = "PING"
)

Redis Command Const

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd interface {
	// SELECT
	SELECT(int) Cmd
	// SET Key Value
	SET(key, value interface{}) Cmd
	// DELETE Key
	DELETE(key string) Cmd
	// GET Key
	GET(key string) interface{}
	// GETByInt64
	GETByInt64(key string) int64
	// GETSET Key
	GETSET(key, value string) interface{}
	// SETTEX  Key , value , ttl
	SETEX(key, value string, ttl int64) Cmd
	// EXPIRE key , ttl
	EXPIRE(key string, ttl int64) Cmd
	//
	EXISTS(key string) bool
	// TTL key
	TTL(key string) int64
	// HSET key , filed , value
	HSET(key, filed, value string) Cmd
	// HMSET key , kv
	HMSET(kv []interface{}) Cmd
	// HGET key ,filed
	HGET(key, filed string) interface{}
	//
	HGETALL(key string) map[string]string
	//
	HDEL(key, filed string) Cmd
	//
	HLEN(key string) int64
	//
	KEYS(pattern string) []string
	//
	SCAN(match string, count int) []string
	//
	INCR(key string) int64
	//
	DECR(key string) int64
	//
	INCRBy(key string, amount int64) int64
	//
	DECRBy(key string, amount int64) int64
	//
	Error() error
	//
	Close()
	//
	ToString(interface{}) string
}

Cmd - Redis cmds

type Redis

type Redis interface {
	New() Cmd
	Status() string
	Close()
}

Redis -

func Dial

func Dial(c config.Config) (Redis, errors.Error)

Dial - dial the redis server

Jump to

Keyboard shortcuts

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