Documentation ¶
Index ¶
- type Connection
- func (c *Connection) Close() error
- func (c *Connection) GetChannels() []string
- func (c *Connection) GetPassword() string
- func (c *Connection) RemoteAddr() net.Addr
- func (c *Connection) SetPassword(password string)
- func (c *Connection) SubsCount() int
- func (c *Connection) Subscribe(channel string)
- func (c *Connection) UnSubscribe(channel string)
- func (c *Connection) Write(b []byte) 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) GetChannels ¶
func (c *Connection) GetChannels() []string
GetChannels returns all subscribing channels
func (*Connection) GetPassword ¶
func (c *Connection) GetPassword() string
GetPassword get password for authentication
func (*Connection) RemoteAddr ¶
func (c *Connection) RemoteAddr() net.Addr
RemoteAddr returns the remote network address
func (*Connection) SetPassword ¶
func (c *Connection) SetPassword(password string)
SetPassword stores password for authentication
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
func (*Connection) Write ¶
func (c *Connection) Write(b []byte) error
Write sends response to client over tcp connection
type FakeConn ¶
type FakeConn struct { Connection // contains filtered or unexported fields }
FakeConn implements redis.Connection for test
Click to show internal directories.
Click to hide internal directories.