redis

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	sync.RWMutex
	Opt   *Option
	Ring  *consistent.Consistent
	Pools map[string]*Pool
}

func (*Group) Close

func (c *Group) Close() error

func (*Group) Do

func (c *Group) Do(command string, args ...interface{}) (interface{}, error)

func (*Group) DoWithTimeout

func (c *Group) DoWithTimeout(timeout time.Duration, command string, args ...interface{}) (interface{}, error)

func (*Group) Stats

func (c *Group) Stats() (map[string]redigo.PoolStats, error)

type Manager

type Manager interface {
	Do(command string, args ...interface{}) (interface{}, error)
	DoWithTimeout(timeout time.Duration, command string, args ...interface{}) (interface{}, error)
	Close() error
	Stats() (map[string]redigo.PoolStats, error)
}

func NewManager

func NewManager(addrs []string) (Manager, error)

type Option

type Option struct {
	Idle            int           // max idle connection count
	Active          int           // max active connection count
	IdleTimeout     time.Duration // connection will remain for this duration
	ConnTimeout     time.Duration // tcp handshake timeout
	ReadTimeout     time.Duration // request read timeout
	WriteTimeout    time.Duration // read and response timeout
	MaxConnLifetime time.Duration // per connection max alive duration
	Wait            bool          // if pool is overflow at max active limit, whether wait
}

type Pool

type Pool struct {
	*redigo.Pool
	Addr string
}

Jump to

Keyboard shortcuts

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