|
|
@@ -195,18 +195,18 @@ QQ群:646049993 |
|
|
|
|
|
|
|
🔍 当然,如果你的服务无需自动扩容,那就不必自动注册WorkerId,而是为它们分别设置全局唯一值。
|
|
|
|
|
|
|
|
🔍 更多方法源自你出色的想象力,此处抛砖引玉地举例,如:开发中心化的ID生成服务,由它为各端点服务(单个或批量)生成可用ID。
|
|
|
|
🔍 发挥你的想象力,方法还有很多。此处抛砖引玉:开发中心化的ID生成服务,由它为各端点服务(单个或批量)生成可用ID。
|
|
|
|
|
|
|
|
|
|
|
|
#### 自动注册流程图
|
|
|
|
|
|
|
|
图片链接:https://gitee.com/yitter/idgenerator/blob/master/Tools/AutoRegisterWorkerId/regprocess.jpg
|
|
|
|
图片链接:https://github.com/yitter/IdGenerator/blob/master/Tools/AutoRegisterWorkerId/regprocess.jpg
|
|
|
|
|
|
|
|
源码路径:/Go/source/regworkerid/reghelper.go
|
|
|
|
|
|
|
|
#### 动态库下载
|
|
|
|
|
|
|
|
下载链接:https://gitee.com/yitter/idgenerator/attach_files/662372/download/regworkerid_lib_v1.0.zip
|
|
|
|
下载链接:https://github.com/yitter/IdGenerator/releases/download/reg_v1.0/regworkerid_lib_v1.0.zip
|
|
|
|
|
|
|
|
#### 动态库接口定义
|
|
|
|
```
|
|
|
@@ -226,16 +226,16 @@ extern GoInt32 Validate(GoInt32 workerId); |
|
|
|
|
|
|
|
## 已实现的语言
|
|
|
|
|
|
|
|
| 语言 | github | gitee |
|
|
|
|
| ---- | ---- | ---- |
|
|
|
|
| 🌲 C# | [查看示例][1] | [查看示例][11] |
|
|
|
|
| 🌲 Java | [查看示例][2] | [查看示例][21] |
|
|
|
|
| 🌲 Go| [查看示例][3] | [查看示例][31] |
|
|
|
|
| 🌲 Rust | [查看示例][4] | [查看示例][41] |
|
|
|
|
| 🌲 C | [查看示例][5] | [查看示例][51] |
|
|
|
|
| 🌲 C (PHP扩展) | [查看示例][7] | [查看示例][71] |
|
|
|
|
| 🌲 V | [查看示例][6] | [查看示例][61] |
|
|
|
|
| 🌲 D | [查看示例][72] | [查看示例][73] |
|
|
|
|
| 语言 | github |
|
|
|
|
| ---- | ---- |
|
|
|
|
| 🌲 C# | [查看示例][1] |
|
|
|
|
| 🌲 Java | [查看示例][2] |
|
|
|
|
| 🌲 Go| [查看示例][3] |
|
|
|
|
| 🌲 Rust | [查看示例][4] |
|
|
|
|
| 🌲 C | [查看示例][5] |
|
|
|
|
| 🌲 C (PHP扩展) | [查看示例][7] |
|
|
|
|
| 🌲 V | [查看示例][6] |
|
|
|
|
| 🌲 D | [查看示例][72] |
|
|
|
|
|
|
|
|
|
|
|
|
[comment]: <> ( ## 为什么用雪花ID?)
|
|
|
|