redisx

package
v0.0.0-...-298ae05 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2020 License: Apache-2.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 interface {
	Init(...Option)
	Conn() (pool redis.Conn)
}

func NewCache

func NewCache(driver string) Cache

type Option

type Option func(opts *Options)

func WithAddr

func WithAddr(addr string) Option

func WithDB

func WithDB(db string) Option

func WithMaxActive

func WithMaxActive(active int) Option

func WithMaxIdle

func WithMaxIdle(idle int) Option

func WithPwd

func WithPwd(pwd string) Option

func WithTimeout

func WithTimeout(timeout time.Duration) Option

type Options

type Options struct {
	Addr      string
	Password  string
	Database  string
	Timeout   time.Duration
	MaxIdle   int
	MaxActive int
}

func DefaultOpts

func DefaultOpts() *Options

Jump to

Keyboard shortcuts

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