cache

package
v0.0.0-...-7c60c3b Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultConfig = Options{
		Wait:            false,
		MaxIdle:         10,
		MaxActive:       100,
		IdleTimeout:     0,
		MaxConnLifetime: 0,
		DialTimeout:     time.Second * 3,
		Addr:            "localhost:6379",
	}
)

default values

Functions

This section is empty.

Types

type Option

type Option func(*Options)

func OptionAddr

func OptionAddr(addr string) Option

选项(使用新配置)

func OptionHost

func OptionHost(host string) Option

type Options

type Options struct {
	Addr            string
	Wait            bool
	MaxIdle         int
	MaxActive       int
	IdleTimeout     time.Duration
	MaxConnLifetime time.Duration
	DialTimeout     time.Duration
}

class redis Options

func NewRedis

func NewRedis(opts ...Option) *Options

*通过默认配置修改一些选项来获得新配置

func (Options) Copy

func (this Options) Copy(opts ...Option) *Options

* 修改个别配置,获得新的配置表来启动redis

func (*Options) Filler

func (this *Options) Filler(p *redis.Pool) *redis.Pool

* 通过配置表来填充redis池的配置选项

func (*Options) Open

func (this *Options) Open() *redis.Pool

* 通过配置新建一个连接池

func (*Options) String

func (this *Options) String() string

Jump to

Keyboard shortcuts

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