data

package
v0.0.0-...-72a7674 Latest Latest
Warning

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

Go to latest
Published: May 26, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Example_CMD

func Example_CMD(rdb *redis.Client)

func Example_Hash

func Example_Hash(rdb *redis.Client)

func Example_HyperLogLog

func Example_HyperLogLog(rdb *redis.Client)

用来做基数统计的算法,HyperLogLog 的优点是,在输入元素的数量或者体积非常非常大时, 计算基数所需的空间总是*固定*的,并且是很小的。 每个 HyperLogLog 键只需要花费 12 KB 内存,就可以计算接近 2^64 个不同元素的基数 适合每月的每日签到情况

func Example_List

func Example_List(rdb *redis.Client)

func Example_PubSub

func Example_PubSub(rdb *redis.Client)

订阅 发布

func Example_Scan

func Example_Scan(rdb *redis.Client)

func Example_Script

func Example_Script(rdb *redis.Client)

func Example_Set

func Example_Set(rdb *redis.Client)

func Example_SortedSet

func Example_SortedSet(rdb *redis.Client)

func Example_String

func Example_String(rdb *redis.Client)

func Example_Tx

func Example_Tx(rdb *redis.Client)

func TestRedisBase

func TestRedisBase(logs klog.Logger)

Types

type RedisService

type RedisService struct {
	Client *redis.Client
	Logger *log.Helper
}

func NewRedisService

func NewRedisService(logs log.Logger) (*RedisService, error)

func (*RedisService) Close

func (rs *RedisService) Close() error

func (*RedisService) GetPlayerUsername

func (rs *RedisService) GetPlayerUsername(playerId int) (string, error)

func (*RedisService) SetPlayerUsername

func (rs *RedisService) SetPlayerUsername(playerId int, username string) error

Jump to

Keyboard shortcuts

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