redis

package module
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 13 Imported by: 11

README

redis

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetEncryptKeys

func SetEncryptKeys(key, iv []byte)

func StringsToInterfaces

func StringsToInterfaces(in []string) []interface{}

Types

type Config added in v0.0.3

type Config struct {
	Host           string
	Password       string
	DB             int
	MaxActive      int
	MaxIdle        int
	IdleTimeout    config.Duration
	ConnectTimeout config.Duration
	ReadTimeout    config.Duration
	WriteTimeout   config.Duration
	LogSlow        config.Duration
	// contains filtered or unexported fields
}

func (*Config) ConfigureBy added in v0.1.17

func (conf *Config) ConfigureBy(setting string)

func (*Config) Dsn added in v0.0.4

func (conf *Config) Dsn() string

type Redis

type Redis struct {
	ReadTimeout int
	Config      *Config

	Error error

	SubRunning bool
	// contains filtered or unexported fields
}

func GetRedis

func GetRedis(name string, logger *log.Logger) *Redis

func NewRedis added in v0.0.3

func NewRedis(conf *Config, logger *log.Logger) *Redis

func (*Redis) CopyByLogger added in v0.1.17

func (rd *Redis) CopyByLogger(logger *log.Logger) *Redis

func (*Redis) DECR

func (rd *Redis) DECR(key string) int64

func (*Redis) DEL

func (rd *Redis) DEL(keys ...string) int

func (*Redis) Destroy

func (rd *Redis) Destroy() error

func (*Redis) Do

func (rd *Redis) Do(cmd string, values ...interface{}) *Result

func (*Redis) EXISTS

func (rd *Redis) EXISTS(key string) bool

func (*Redis) EXPIRE

func (rd *Redis) EXPIRE(key string, second int) bool

func (*Redis) GET

func (rd *Redis) GET(key string) *Result

func (*Redis) GETSET

func (rd *Redis) GETSET(key string, value interface{}) *Result

func (*Redis) GetConnection

func (rd *Redis) GetConnection() redis.Conn

func (*Redis) GetLogger added in v0.1.3

func (rd *Redis) GetLogger() *log.Logger

func (*Redis) GetPool

func (rd *Redis) GetPool() *redis.Pool

func (*Redis) HDECR

func (rd *Redis) HDECR(key, field string) int64

func (*Redis) HDEL

func (rd *Redis) HDEL(key string, fields ...string) int

func (*Redis) HEXISTS

func (rd *Redis) HEXISTS(key, field string) bool

func (*Redis) HGET

func (rd *Redis) HGET(key, field string) *Result

func (*Redis) HGETALL

func (rd *Redis) HGETALL(key string) map[string]*Result

func (*Redis) HINCR

func (rd *Redis) HINCR(key, field string) int64

func (*Redis) HKEYS

func (rd *Redis) HKEYS(key string) []string

func (*Redis) HLEN

func (rd *Redis) HLEN(key string) int

func (*Redis) HMGET

func (rd *Redis) HMGET(key string, fields ...string) []Result

func (*Redis) HMSET

func (rd *Redis) HMSET(key string, fieldAndValues ...interface{}) bool

func (*Redis) HSET

func (rd *Redis) HSET(key, field string, value interface{}) bool

func (*Redis) HSETNX

func (rd *Redis) HSETNX(key, field string, value interface{}) bool

func (*Redis) INCR

func (rd *Redis) INCR(key string) int64

func (*Redis) KEYS

func (rd *Redis) KEYS(patten string) []string

func (*Redis) LLEN

func (rd *Redis) LLEN(key string) int

func (*Redis) LPOP

func (rd *Redis) LPOP(key string) *Result

func (*Redis) LPUSH

func (rd *Redis) LPUSH(key string, values ...string) int

func (*Redis) LRANGE

func (rd *Redis) LRANGE(key string, start, stop int) []Result

func (*Redis) LogError added in v0.0.4

func (rd *Redis) LogError(error string)

func (*Redis) LogQuery added in v0.0.4

func (rd *Redis) LogQuery(query string, args []interface{}, usedTime float32)

func (*Redis) LogQueryError added in v0.0.4

func (rd *Redis) LogQueryError(error string, query string, args []interface{}, usedTime float32)

func (*Redis) MGET

func (rd *Redis) MGET(keys ...string) []Result

func (*Redis) MSET

func (rd *Redis) MSET(keyAndValues ...interface{}) bool

func (*Redis) PUBLISH added in v0.1.17

func (rd *Redis) PUBLISH(channel, data string) bool

func (*Redis) RPOP

func (rd *Redis) RPOP(key string) *Result

func (*Redis) RPUSH

func (rd *Redis) RPUSH(key string, values ...string) int

func (*Redis) SET

func (rd *Redis) SET(key string, value interface{}) bool

func (*Redis) SETEX

func (rd *Redis) SETEX(key string, seconds int, value interface{}) bool

func (*Redis) SETNX

func (rd *Redis) SETNX(key string, value interface{}) bool

func (*Redis) SetLogger added in v0.1.3

func (rd *Redis) SetLogger(logger *log.Logger)

func (*Redis) Start added in v0.1.17

func (rd *Redis) Start()

func (*Redis) Stop added in v0.1.17

func (rd *Redis) Stop()

func (*Redis) Subscribe added in v0.1.17

func (rd *Redis) Subscribe(name string, reset func(), received func([]byte)) bool

func (*Redis) Unsubscribe added in v0.1.17

func (rd *Redis) Unsubscribe(name string) bool

type Result

type Result struct {
	Error error
	// contains filtered or unexported fields
}

func (*Result) Bool

func (rs *Result) Bool() bool

func (*Result) Bytes added in v0.1.17

func (rs *Result) Bytes() []byte

func (*Result) Float

func (rs *Result) Float() float32

func (*Result) Float64

func (rs *Result) Float64() float64

func (*Result) Int

func (rs *Result) Int() int

func (*Result) Int16

func (rs *Result) Int16() int16

func (*Result) Int32

func (rs *Result) Int32() int32

func (*Result) Int64

func (rs *Result) Int64() int64

func (*Result) Int8

func (rs *Result) Int8() int8

func (*Result) IntMap

func (rs *Result) IntMap() map[string]int

func (*Result) Ints

func (rs *Result) Ints() []int

func (*Result) ResultMap

func (rs *Result) ResultMap() map[string]*Result

func (*Result) Results

func (rs *Result) Results() []Result

func (*Result) String

func (rs *Result) String() string

func (*Result) StringMap

func (rs *Result) StringMap() map[string]string

func (*Result) Strings

func (rs *Result) Strings() []string

func (*Result) To

func (rs *Result) To(result interface{}) error

func (*Result) ToValue

func (rs *Result) ToValue(t reflect.Type) reflect.Value

func (*Result) Uint

func (rs *Result) Uint() uint

func (*Result) Uint16

func (rs *Result) Uint16() uint16

func (*Result) Uint32

func (rs *Result) Uint32() uint32

func (*Result) Uint64

func (rs *Result) Uint64() uint64

func (*Result) Uint8

func (rs *Result) Uint8() uint8

type SubCallbacks added in v0.1.17

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

Jump to

Keyboard shortcuts

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