redispool

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URL               string        `env:"REDIS_URL,default=redis://127.0.0.1:6379"`
	MaxIdleConns      int           `env:"REDIS_MAX_IDLE_CONNS,default=1"`
	MaxActiveConns    int           `env:"REDIS_MAX_ACTIVE_CONNS,default=50"`
	IdleTimeout       time.Duration `env:"REDIS_IDLE_TIMEOUT,default=0s"`
	IdleProbeInterval time.Duration `env:"REDIS_IDLE_PROBE_INTERVAL,default=0s"`
	AttachmentNames   []string      `env:"REDIS_ATTACHMENT_NAMES"`
}

Config stores all the basic redis pool configuration knobs.

func (Config) Pool

func (c Config) Pool() *redis.Pool

Pool returns a *redis.Pool given the configured env vars in Config.

func (Config) Pools

func (c Config) Pools() ([]*redis.Pool, error)

Pools returns a *redis.Pool for each of the provided Config values.

Jump to

Keyboard shortcuts

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