cache

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidConn 无法获取与 redis-server 的连接
	ErrInvalidConn = errors.New("invalid conn")
)

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Open() error
	Close() error
	Conn() (Conn, error)
	DO(cmd string, args ...interface{}) (interface{}, error)
	String(key string) (string, error)
	SetString(key, value string, ex string) (interface{}, error)
	// contains filtered or unexported methods
}

Cache 缓存

func NewCache

func NewCache(opts ...Option) Cache

NewCache ..

type Conn

type Conn interface {
	Send(cmd string, args ...interface{}) error
	Flush() error
	Close() error
}

Conn 连接

type Option

type Option func(Cache)

Option ..

func WithDB

func WithDB(db int) Option

WithDB 0-15

func WithHost

func WithHost(host string) Option

WithHost 地址

func WithIdleTimeout

func WithIdleTimeout(timeout time.Duration) Option

WithIdleTimeout ..

func WithMaxActive

func WithMaxActive(maxActive int) Option

WithMaxActive ..

func WithMaxIdle

func WithMaxIdle(maxIdle int) Option

WithMaxIdle ..

func WithPassword

func WithPassword(password string) Option

WithPassword 密码

func WithPort

func WithPort(port int) Option

WithPort 端口号

func WithWait

func WithWait(wait bool) Option

WithWait ..

Jump to

Keyboard shortcuts

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