Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/alberliu/uid
/ functions
Functions
6 in github.com/alberliu/uid
⨍
Functions
6
◇
Types & classes
2
↓ 2 callers
Method
reLoad
reLoad 在数据库获取id段,如果失败,会每隔一秒尝试一次
uid.go:66
↓ 1 callers
Method
Error
(error)
uid.go:11
↓ 1 callers
Method
getFromDB
getFromDB 从数据库获取id段
uid.go:85
↓ 1 callers
Method
productId
productId 生产id,当ch达到最大容量时,这个方法会阻塞,直到ch中的id被消费
uid.go:52
Method
Get
Get 获取自增id,当发生超时,返回错误,避免大量请求阻塞,服务器崩溃
uid.go:42
Function
NewUid
NewUid 创建一个Uid;len:缓冲池大小() db:数据库连接 businessId:业务id len:缓冲池大小(长度可控制缓存中剩下多少id时,去DB中加载)
uid.go:31