redisconn

package
v0.0.0-...-70285c8 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBufSize = 4 * 1024
)
View Source
const PoolIdleTimeoutSecond = 120

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

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

not thread-safe

func NewConnection

func NewConnection(addr string, netTimeout int) (*Conn, error)

func NewConnectionWithSize

func NewConnectionWithSize(addr string, netTimeout int, readSize int, writeSize int) (*Conn, error)

func (*Conn) BufioReader

func (c *Conn) BufioReader() *bufio.Reader

func (*Conn) Close

func (c *Conn) Close()

func (*Conn) Flush

func (c *Conn) Flush() error

func (*Conn) Read

func (c *Conn) Read(p []byte) (int, error)

require read to use bufio

func (*Conn) SetDeadline

func (c *Conn) SetDeadline(t time.Time) error

func (*Conn) SetReadDeadline

func (c *Conn) SetReadDeadline(t time.Time) error

func (*Conn) SetWriteDeadline

func (c *Conn) SetWriteDeadline(t time.Time) error

func (*Conn) Write

func (c *Conn) Write(p []byte) (int, error)

type CreateConnFunc

type CreateConnFunc func(addr string) (*Conn, error)

type Pool

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

func NewPool

func NewPool(addr string, capability int, f CreateConnFunc) *Pool

func (*Pool) Close

func (p *Pool) Close()

func (*Pool) GetConn

func (p *Pool) GetConn() (*Conn, error)

func (*Pool) PutConn

func (p *Pool) PutConn(c *Conn)

type Pools

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

func NewPools

func NewPools(capability int, f CreateConnFunc) *Pools

func (*Pools) Close

func (p *Pools) Close()

func (*Pools) GetConn

func (p *Pools) GetConn(addr string) (*Conn, error)

func (*Pools) PutConn

func (p *Pools) PutConn(c *Conn)

Jump to

Keyboard shortcuts

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