redis

package
v5.9.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2018 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_CONNECT_TIMEOUT = 30 * time.Second
	DEFAULT_READ_TIMEOUT    = 10 * time.Second
	DEFAULT_WRITE_TIMEOUT   = 10 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(config *Config, logger golog.ILogger) *Client

func (*Client) BeginTrans

func (this *Client) BeginTrans()

func (*Client) Connect

func (this *Client) Connect() error

func (*Client) Connected

func (this *Client) Connected() bool

func (*Client) DiscardTrans

func (this *Client) DiscardTrans() error

func (*Client) Do

func (this *Client) Do(cmd string, args ...interface{}) *Reply

func (*Client) ExecPipelining

func (this *Client) ExecPipelining() ([]*Reply, []int)

func (*Client) ExecTrans

func (this *Client) ExecTrans() ([]*Reply, error)

func (*Client) Free

func (this *Client) Free()

func (*Client) Send

func (this *Client) Send(cmd string, args ...interface{})

func (*Client) SetCmdLogFmtFunc

func (this *Client) SetCmdLogFmtFunc(clff CmdLogFmtFunc) *Client

func (*Client) SetLogger

func (this *Client) SetLogger(logger golog.ILogger) *Client

type CmdLogFmtFunc

type CmdLogFmtFunc func(cmd string, args ...interface{}) []byte

type Config

type Config struct {
	LogLevel int

	Host string
	Port string
	Pass string

	ConnectTimeout time.Duration
	ReadTimeout    time.Duration
	WriteTimeout   time.Duration

	TimeoutAutoReconnect bool
}

func NewConfig

func NewConfig(host, port, pass string) *Config

type PConfig

type PConfig struct {
	pool.Config

	NewClientFunc func() (*Client, error)
}

type Pool

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

func NewPool

func NewPool(config *PConfig) *Pool

func (*Pool) Get

func (this *Pool) Get() (*Client, error)

func (*Pool) Put

func (this *Pool) Put(client *Client) error

type Reply

type Reply struct {
	Err error
	// contains filtered or unexported fields
}

func NewReply

func NewReply(reply interface{}, err error) *Reply

func (*Reply) ArrReplyIsNil

func (this *Reply) ArrReplyIsNil() bool

func (*Reply) Bool

func (this *Reply) Bool() (bool, error)

func (*Reply) ByteSlices

func (this *Reply) ByteSlices() ([][]byte, error)

func (*Reply) Bytes

func (this *Reply) Bytes() ([]byte, error)

func (*Reply) Float64

func (this *Reply) Float64() (float64, error)

func (*Reply) Int

func (this *Reply) Int() (int, error)

func (*Reply) Int64

func (this *Reply) Int64() (int64, error)

func (*Reply) Int64Map

func (this *Reply) Int64Map() (map[string]int64, error)

func (*Reply) Ints

func (this *Reply) Ints() ([]int, error)

func (*Reply) SimpleReplyIsNil

func (this *Reply) SimpleReplyIsNil() bool

func (*Reply) String

func (this *Reply) String() (string, error)

func (*Reply) StringMap

func (this *Reply) StringMap() (map[string]string, error)

func (*Reply) Strings

func (this *Reply) Strings() ([]string, error)

func (*Reply) Struct

func (this *Reply) Struct(s interface{}) error

func (*Reply) Uint64

func (this *Reply) Uint64() (uint64, error)

Jump to

Keyboard shortcuts

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