userhash

package
v0.0.0-...-dae8c3a Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserNameToIdHashNum = 2000

UserNameToIdHashNum 通过用户名按id取模分配的hash缓存,通过用户名来获取用户id

Functions

func GetIdByUserName

func GetIdByUserName(username string, rClient *redis.Client) (int64, error)

GetIdByUserName 通过用户名获取hash的缓存的key来获取值

func HashCodeByString

func HashCodeByString(s string) int

HashCodeByString 加码以字符串

func SetUserNameToId

func SetUserNameToId(username string, userId int64, rClient *redis.Client)

SetUserNameToId 通过用户名的hashcode来写入到hash缓存

Types

This section is empty.

Jump to

Keyboard shortcuts

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