1
0
mirror of synced 2026-10-08 07:46:11 +08:00

auto commit

This commit is contained in:
yitter
2022-08-20 14:52:42 +08:00
parent 1f0a5722bb
commit 443ddcc5bd
5 changed files with 5 additions and 5 deletions

View File

@@ -14,7 +14,7 @@ go get -u -v github.com/yitter/idgenerator-go
第1步,**全局** 初始化(应用程序启动时执行一次):
```
// 创建 IdGeneratorOptions 对象,请在构造函数中输入 WorkerId:
var options = idgen.NewIdGeneratorOptions(1)
var options = idgen.NewIdGeneratorOptions(Your_Worker_Id)
// options.WorkerIdBitLength = 10 // WorkerIdBitLength 默认值6,支持的 WorkerId 最大值为2^6-1,若 WorkerId 超过64,可设置更大的 WorkerIdBitLength
// ...... 其它参数设置参考 IdGeneratorOptions 定义,一般来说,只要再设置 WorkerIdBitLength (决定 WorkerId 的最大值)。