connection

package
v0.0.0-...-c3f54fb Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeepConnection

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

记录连接的相关信息

func NewKeepConnection

func NewKeepConnection(c net.Conn) *KeepConnection

本质就是构建 *KeepConnection对象,存储c net.Conn 以及相关信息

func (*KeepConnection) AddTxError

func (k *KeepConnection) AddTxError(err error)

func (*KeepConnection) CleanWatchKey

func (k *KeepConnection) CleanWatchKey()

func (*KeepConnection) Close

func (k *KeepConnection) Close() error

关闭 *KeepConnection 对象

func (*KeepConnection) EnqueueCmd

func (k *KeepConnection) EnqueueCmd(redisCommand [][]byte)

func (*KeepConnection) GetChannels

func (k *KeepConnection) GetChannels() []string

func (*KeepConnection) GetDBIndex

func (k *KeepConnection) GetDBIndex() int

func (*KeepConnection) GetPassword

func (k *KeepConnection) GetPassword() string

func (*KeepConnection) GetQueuedCmdLine

func (k *KeepConnection) GetQueuedCmdLine() [][][]byte

func (*KeepConnection) GetTxErrors

func (k *KeepConnection) GetTxErrors() []error

func (*KeepConnection) GetWatchKey

func (k *KeepConnection) GetWatchKey() map[string]int64

func (*KeepConnection) IsClosed

func (k *KeepConnection) IsClosed() bool

func (*KeepConnection) IsTransaction

func (k *KeepConnection) IsTransaction() bool

func (*KeepConnection) RemoteAddr

func (k *KeepConnection) RemoteAddr() string

连接远程地址信息

func (*KeepConnection) SetDBIndex

func (k *KeepConnection) SetDBIndex(index int)

当前连接选定的数据库

func (*KeepConnection) SetPassword

func (k *KeepConnection) SetPassword(password string)

密码信息

func (*KeepConnection) SetTransaction

func (k *KeepConnection) SetTransaction(val bool)

func (*KeepConnection) SubCount

func (k *KeepConnection) SubCount() int

func (*KeepConnection) Subscribe

func (k *KeepConnection) Subscribe(channel string)

func (*KeepConnection) Unsubscribe

func (k *KeepConnection) Unsubscribe(channel string)

func (*KeepConnection) Write

func (k *KeepConnection) Write(b []byte) (int, error)

type VirtualConnection

type VirtualConnection struct {
	KeepConnection
	// contains filtered or unexported fields
}

func NewVirtualConn

func NewVirtualConn() *VirtualConnection

func (*VirtualConnection) GetDBIndex

func (v *VirtualConnection) GetDBIndex() int

func (*VirtualConnection) GetPassword

func (v *VirtualConnection) GetPassword() string

func (*VirtualConnection) SetDBIndex

func (v *VirtualConnection) SetDBIndex(index int)

Jump to

Keyboard shortcuts

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