Help us shape the future of Go! Take the 2026 Go Developer Survey

redisdumb

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2020 License: MIT Imports: 6 Imported by: 2

Documentation

Overview

Package redisdumb contains dumbest implementation of redis.Sender

Index

Constants

This section is empty.

Variables

View Source
var DefaultTimeout time.Duration = 5 * time.Second

DefaultTimeout is default timeout.

Functions

func Do

func Do(addr string, cmd string, args ...interface{}) interface{}

Do is shortcut for issuing single command to redis by address.

Types

type Conn

type Conn struct {
	Addr    string
	C       net.Conn
	R       *bufio.Reader
	Timeout time.Duration
	Type    ConnType
}

Conn is a simplest blocking implementation of redis.Sender.

func (*Conn) Close

func (c *Conn) Close()

Close closes connection (implements redis.Sender.Close)

func (*Conn) Do

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

Do issues command to servers. It handles reconnection and redirection (if Conn.Type==TypeCluster).

func (*Conn) EachShard

func (c *Conn) EachShard(f func(redis.Sender, error) bool)

EachShard implements redis.Sender.EachShard.

func (*Conn) Scanner

func (c *Conn) Scanner(opts redis.ScanOpts) redis.Scanner

Scanner implements redis.Sender.Scanner

func (*Conn) Send

func (c *Conn) Send(r redis.Request, cb redis.Future, n uint64)

Send implements redis.Sender.Send

func (*Conn) SendMany

func (c *Conn) SendMany(reqs []redis.Request, cb redis.Future, n uint64)

SendMany implements redis.Sender.SendMany. Note, it does it in a dumb way: commands are executed sequentially.

func (*Conn) SendTransaction

func (c *Conn) SendTransaction(reqs []redis.Request, cb redis.Future, n uint64)

SendTransaction implements redis.Sender.SendTransaction.

type ConnType

type ConnType int

ConnType - type of connection (simple server, or cluster aware).

const (
	// TypeSimple (default) is for connection to single server.
	TypeSimple ConnType = 0
	// TypeCluster is for connection which awares for cluster redirects.
	TypeCluster ConnType = 1
)

type Scanner

type Scanner struct {
	redis.ScannerBase
	// contains filtered or unexported fields
}

Scanner implements redis.Scanner

func (*Scanner) Next

func (s *Scanner) Next(cb redis.Future)

Next implements redis.Scanner.Next

Jump to

Keyboard shortcuts

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