rediswrap

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorInit = 1 + iota
	ErrorCmd
	ErrorClose
	ErrorMarshal
	ErrorTypeCast
	ErrorPipeline
)

Variables

This section is empty.

Functions

func ParseUrl added in v1.0.3

func ParseUrl(redisUrl string) (*redis.Options, error)

Types

type Options

type Options struct {
	//Url eg. redis://:qwerty@localhost:6379/1
	Url          string
	PoolSize     int
	MinIdleConns int
	IdleTimeout  int
}

type Redis

type Redis struct {
	*redis.Client
}

func New

func New(options Options) *Redis

func NewFromOption added in v1.0.3

func NewFromOption(option *redis.Options) *Redis

func NewFromUrl added in v1.0.3

func NewFromUrl(redisUrl string) *Redis

func (*Redis) Close

func (r *Redis) Close()

func (*Redis) Get

func (r *Redis) Get(key string) *redis.StringCmd

func (*Redis) GetJson

func (r *Redis) GetJson(key string, result interface{}) bool

func (*Redis) GetJsons

func (r *Redis) GetJsons(keys []string, result interface{}) bool

func (*Redis) HGetJson

func (r *Redis) HGetJson(key, field string, result interface{}) bool

func (*Redis) HMGetAllJson

func (r *Redis) HMGetAllJson(key string, result interface{})

func (*Redis) HSetJson

func (r *Redis) HSetJson(key, field string, value interface{})

func (*Redis) Marshal

func (r *Redis) Marshal(v interface{}) string

func (*Redis) Set

func (r *Redis) Set(key string, value interface{}, secs int)

func (*Redis) SetJson

func (r *Redis) SetJson(key string, result interface{}, secs int)

func (*Redis) SetJsons

func (r *Redis) SetJsons(keys []string, values interface{}, secs int)

func (*Redis) SetJsonsByKv

func (r *Redis) SetJsonsByKv(kvs map[string]interface{}, secs int)

func (*Redis) Unmarshal

func (r *Redis) Unmarshal(str string, result interface{})

type StringCmd

type StringCmd struct {
	*redis.StringCmd
}

func (*StringCmd) Bytes

func (s *StringCmd) Bytes() []byte

func (*StringCmd) Float32

func (s *StringCmd) Float32() float32

func (*StringCmd) Float64

func (s *StringCmd) Float64() float64

func (*StringCmd) Int

func (s *StringCmd) Int() int

func (*StringCmd) Int64

func (s *StringCmd) Int64() int64

func (*StringCmd) Time

func (s *StringCmd) Time() time.Time

func (*StringCmd) Uint64

func (s *StringCmd) Uint64() uint64

Jump to

Keyboard shortcuts

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