Documentation ¶
Index ¶
- type Connection
- func (c *Connection) AddTxError(err error)
- func (c *Connection) ClearQueuedCmds()
- func (c *Connection) Close() error
- func (c *Connection) EnqueueCmd(cmdLine [][]byte)
- func (c *Connection) GetChannels() []string
- func (c *Connection) GetDBIndex() int
- func (c *Connection) GetPassword() string
- func (c *Connection) GetQueuedCmdLine() [][][]byte
- func (c *Connection) GetTxErrors() []error
- func (c *Connection) GetWatching() map[string]uint32
- func (c *Connection) InMultiState() bool
- func (c *Connection) IsMaster() bool
- func (c *Connection) IsSlave() bool
- func (c *Connection) Name() string
- func (c *Connection) RemoteAddr() string
- func (c *Connection) SelectDB(dbNum int)
- func (c *Connection) SetMaster()
- func (c *Connection) SetMultiState(state bool)
- func (c *Connection) SetPassword(password string)
- func (c *Connection) SetSlave()
- func (c *Connection) SubsCount() int
- func (c *Connection) Subscribe(channel string)
- func (c *Connection) UnSubscribe(channel string)
- func (c *Connection) Write(b []byte) (int, error)
- type FakeConn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection represents a connection with a redis-cli
func (*Connection) AddTxError ¶
func (c *Connection) AddTxError(err error)
AddTxError stores syntax error within transaction
func (*Connection) ClearQueuedCmds ¶
func (c *Connection) ClearQueuedCmds()
ClearQueuedCmds clears queued commands of current transaction
func (*Connection) EnqueueCmd ¶
func (c *Connection) EnqueueCmd(cmdLine [][]byte)
EnqueueCmd enqueues command of current transaction
func (*Connection) GetChannels ¶
func (c *Connection) GetChannels() []string
GetChannels returns all subscribing channels
func (*Connection) GetDBIndex ¶
func (c *Connection) GetDBIndex() int
GetDBIndex returns selected db
func (*Connection) GetPassword ¶
func (c *Connection) GetPassword() string
GetPassword get password for authentication
func (*Connection) GetQueuedCmdLine ¶
func (c *Connection) GetQueuedCmdLine() [][][]byte
GetQueuedCmdLine returns queued commands of current transaction
func (*Connection) GetTxErrors ¶
func (c *Connection) GetTxErrors() []error
GetTxErrors returns syntax error within transaction
func (*Connection) GetWatching ¶
func (c *Connection) GetWatching() map[string]uint32
GetWatching returns watching keys and their version code when started watching
func (*Connection) InMultiState ¶
func (c *Connection) InMultiState() bool
InMultiState tells is connection in an uncommitted transaction
func (*Connection) IsMaster ¶
func (c *Connection) IsMaster() bool
func (*Connection) IsSlave ¶
func (c *Connection) IsSlave() bool
func (*Connection) Name ¶
func (c *Connection) Name() string
func (*Connection) RemoteAddr ¶
func (c *Connection) RemoteAddr() string
RemoteAddr returns the remote network address
func (*Connection) SetMaster ¶
func (c *Connection) SetMaster()
func (*Connection) SetMultiState ¶
func (c *Connection) SetMultiState(state bool)
SetMultiState sets transaction flag
func (*Connection) SetPassword ¶
func (c *Connection) SetPassword(password string)
SetPassword stores password for authentication
func (*Connection) SetSlave ¶
func (c *Connection) SetSlave()
func (*Connection) SubsCount ¶
func (c *Connection) SubsCount() int
SubsCount returns the number of subscribing channels
func (*Connection) Subscribe ¶
func (c *Connection) Subscribe(channel string)
Subscribe add current connection into subscribers of the given channel
func (*Connection) UnSubscribe ¶
func (c *Connection) UnSubscribe(channel string)
UnSubscribe removes current connection into subscribers of the given channel
type FakeConn ¶
type FakeConn struct { Connection // contains filtered or unexported fields }
FakeConn implements redis.Connection for test
func NewFakeConn ¶
func NewFakeConn() *FakeConn