redis

package
v0.0.0-...-dc66ec4 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func NewCache

func NewCache(op Options) (*Cache, error)

func (*Cache) Close

func (r *Cache) Close() error

func (*Cache) Del

func (r *Cache) Del(key string) error

func (*Cache) Get

func (r *Cache) Get(key string, value interface{}) (err error)

Get value must a pointer

func (*Cache) Lua

func (r *Cache) Lua(lua string, keys ...string) (interface{}, error)

func (*Cache) PatternDel

func (r *Cache) PatternDel(pattern string) error

func (*Cache) Set

func (r *Cache) Set(key string, value interface{}) error

func (*Cache) SetWithExp

func (r *Cache) SetWithExp(key string, value interface{}, exp time.Duration) error

type Logger

type Logger interface {
	Debug(format string, args ...interface{})
	Info(format string, args ...interface{})
	Error(format string, args ...interface{})
}

type Options

type Options struct {
	NodeAddr       []string
	SentinelEnable bool
	MasterName     string
	PoolSize       int
	Db             int
	Password       string
	Logger         Logger

	TTL          time.Duration
	DialTimeOut  time.Duration
	WriteTimeout time.Duration
	ReadTimeout  time.Duration
	PoolTimeout  time.Duration
}

Jump to

Keyboard shortcuts

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