Version: v1.2.7 Latest Latest

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

Go to latest
Published: Jun 20, 2021 License: GPL-3.0 Imports: 5 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type Connection

type Connection struct {
	// contains filtered or unexported fields

Connection represents a connection with a redis-cli

func NewConn

func NewConn(conn net.Conn) *Connection

NewConn creates Connection instance

func (*Connection) ClearQueuedCmds added in v1.2.7

func (c *Connection) ClearQueuedCmds()

func (*Connection) Close

func (c *Connection) Close() error

Close disconnect with the client

func (*Connection) EnqueueCmd added in v1.2.7

func (c *Connection) EnqueueCmd(cmdLine [][]byte)

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) GetQueuedCmdLine added in v1.2.7

func (c *Connection) GetQueuedCmdLine() [][][]byte

func (*Connection) GetWatching added in v1.2.7

func (c *Connection) GetWatching() map[string]uint32

func (*Connection) InMultiState added in v1.2.7

func (c *Connection) InMultiState() bool

func (*Connection) RemoteAddr

func (c *Connection) RemoteAddr() net.Addr

RemoteAddr returns the remote network address

func (*Connection) SetMultiState added in v1.2.7

func (c *Connection) SetMultiState(state bool)

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 {
	// contains filtered or unexported fields

FakeConn implements redis.Connection for test

func (*FakeConn) Bytes

func (c *FakeConn) Bytes() []byte

Bytes returns written data

func (*FakeConn) Clean

func (c *FakeConn) Clean()

Clean resets the buffer

func (*FakeConn) Write

func (c *FakeConn) Write(b []byte) error

Write writes data to buffer

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL