redis

package
v0.0.0-...-6856ae1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClosedPool = errors.New("use of closed redis pool")

Functions

This section is empty.

Types

type Client

type Client struct {
	LastUse time.Time
	Timeout time.Duration
	// contains filtered or unexported fields
}

func NewClient

func NewClient(addr string, auth string, timeout time.Duration) (*Client, error)

func NewClientNoAuth

func NewClientNoAuth(addr string, timeout time.Duration) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) Do

func (c *Client) Do(cmd string, args ...interface{}) (interface{}, error)

func (*Client) Flush

func (c *Client) Flush(cmd string, args ...interface{}) error

func (*Client) Info

func (c *Client) Info() (map[string]string, error)

func (*Client) InfoFull

func (c *Client) InfoFull() (map[string]string, error)

func (*Client) MigrateSlot

func (c *Client) MigrateSlot(slot int, target string) (int, error)

func (*Client) Receive

func (c *Client) Receive() (interface{}, error)

func (*Client) Role

func (c *Client) Role() (string, error)

func (*Client) SetMaster

func (c *Client) SetMaster(master string) error

func (*Client) SlotsInfo

func (c *Client) SlotsInfo() (map[int]int, error)

type MonitorConfig

type MonitorConfig struct {
	Quorum          int
	ParallelSyncs   int
	DownAfter       time.Duration
	FailoverTimeout time.Duration
}

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

func NewPool

func NewPool(auth string, timeout time.Duration) *Pool

func (*Pool) Cleanup

func (p *Pool) Cleanup() error

func (*Pool) Close

func (p *Pool) Close() error

func (*Pool) GetClient

func (p *Pool) GetClient(addr string) (*Client, error)

func (*Pool) Info

func (p *Pool) Info(addr string) (map[string]string, error)

func (*Pool) InfoFull

func (p *Pool) InfoFull(addr string) (map[string]string, error)

func (*Pool) MigrateSlot

func (p *Pool) MigrateSlot(slot int, from, dest string) (int, error)

func (*Pool) PutClient

func (p *Pool) PutClient(c *Client)

type Sentinel

type Sentinel struct {
	context.Context
	Cancel context.CancelFunc
	// contains filtered or unexported fields
}

func NewSentinel

func NewSentinel(product, auth string) *Sentinel

func (*Sentinel) FlushConfig

func (s *Sentinel) FlushConfig(sentinel string) error

func (*Sentinel) InfoMonitored

func (s *Sentinel) InfoMonitored(sentinel string, timeout time.Duration) (map[string]interface{}, error)

func (*Sentinel) IsCancelled

func (s *Sentinel) IsCancelled() bool

func (*Sentinel) Masters

func (s *Sentinel) Masters(groups map[int]bool, timeout time.Duration, sentinels ...string) map[int]string

func (*Sentinel) Monitor

func (s *Sentinel) Monitor(masters map[int]string, config *MonitorConfig, timeout time.Duration, sentinels ...string) error

func (*Sentinel) Subscribe

func (s *Sentinel) Subscribe(timeout time.Duration, sentinels ...string) bool

func (*Sentinel) Unmonitor

func (s *Sentinel) Unmonitor(groups map[int]bool, timeout time.Duration, sentinels ...string) error

func (*Sentinel) WatchNode

func (s *Sentinel) WatchNode(gid int) string

Jump to

Keyboard shortcuts

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