redido

package module
v0.0.0-...-31a7acf Latest Latest
Warning

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

Go to latest
Published: May 26, 2015 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn interface {
	// Do sends a command to the server and returns the received reply.
	Do(commandName string, args ...interface{}) (reply interface{}, err error)

	// Close closes the connection.
	Close() error
}

Conn iterface exposes Do and Close. It's a subset of redigo.Conn interface.

type ConnFactory

type ConnFactory func() (Conn, error)

ConnFactory is a function returning new connections

type Doer

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

Doer does the Do, reconnecting when necessary

func New

func New(cf ConnFactory) *Doer

New returns new Doer which will use passed connection factory to estabilish new connections.

func NewDialTimeout

func NewDialTimeout(network, address string, connectTimeout, readTimeout, writeTimeout time.Duration) *Doer

NewDialTimeout will dial using redis.DialTimeout with passed parameters. No connections is being estabilished by calling this function.

func (*Doer) Close

func (d *Doer) Close()

Close closes the underlying connection.

func (*Doer) Do

func (d *Doer) Do(cmd string, args ...interface{}) (reply interface{}, err error)

Do does the command with arguments. Retries on network error.

Jump to

Keyboard shortcuts

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