redis_storage

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisNode

type RedisNode struct {
	RedisConf *redis.Options
	Position  int64 //the position of hash ring
}

type RedisStorage

type RedisStorage struct {
	session_storage.SessionStorage
	// contains filtered or unexported fields
}

func NewRedisStorage

func NewRedisStorage(redisClient *eredis.RedisClient) *RedisStorage

NewRedisStorage return a RedisStorage

func (*RedisStorage) BindClientId

func (this *RedisStorage) BindClientId(nodeAddr string, clientId string) error

BindClientId set online with clientId

func (*RedisStorage) ClientIdsOnline

func (this *RedisStorage) ClientIdsOnline(clientIds []string) []string

ClientIdsOnline Get online users in the group

func (*RedisStorage) ClientIdsOnlineWithLua

func (this *RedisStorage) ClientIdsOnlineWithLua(clientIds []string) []string

ClientIdsOnlineWithLua Get online users in the group

func (*RedisStorage) GetClientsIps

func (this *RedisStorage) GetClientsIps(clientIds []string) (map[string][]string, error)

GetIps get ip list by clientId list

func (*RedisStorage) GetIps

func (this *RedisStorage) GetIps(clientId string) ([]string, error)

GetIps get ip list by clientId

func (*RedisStorage) IsOnline

func (this *RedisStorage) IsOnline(clientId string) bool

IsOnline determine if a clientId is online

func (*RedisStorage) OnClientPing

func (this *RedisStorage) OnClientPing(nodeAddr string, clientId string) error

OnClientPing receive client heartbeat

Jump to

Keyboard shortcuts

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