1
0
mirror of synced 2026-02-06 13:07:55 +08:00

auto commit

This commit is contained in:
yitter
2023-06-20 20:46:15 +08:00
parent bad4fb36c6
commit d12b8e9d00
2 changed files with 10 additions and 9 deletions

View File

@@ -36,8 +36,8 @@ func main() {
// password: Redis连接密码
// db: Redis指定存储库示例1
// sentinelMasterName: Redis 哨兵模式下的服务名称示例mymaster非哨兵模式传入空字符串即可
// maxWorkerId: WorkerId 最大值示例63
// minWorkerId: WorkerId 最小值示例30
// maxWorkerId: WorkerId 最大值示例63
// lifeTimeSeconds: WorkerId缓存时长3的倍数
//export RegisterOne
func RegisterOne(address *C.char, password *C.char, db int, sentinelMasterName *C.char, minWorkerId int32, maxWorkerId int32, lifeTimeSeconds int32) int32 {

View File

@@ -221,22 +221,23 @@
#### 动态库下载
下载链接1https://github.com/yitter/IdGenerator/releases/download/v1.3.1/regworkerid_lib_v1.3.1.zip
下载链接1https://github.com/yitter/IdGenerator/releases/download/v1.3.3/workeridgo_lib_v1.3.3.zip
#### 动态库接口定义
```
// 注册一个 WorkerId会先注销所有本机已注册的记录
// ip: redis 服务器地址
// port: redis 端口
// password: redis 访问密码,可为空字符串“”
// maxWorkerId: 最大 WorkerId
extern GoInt32 RegisterOne(char* ip, GoInt32 port, char* password, GoInt32 maxWorkerId);
// address: Redis连接地址单机模式示例127.0.0.1:6379哨兵/集群模式示例127.0.0.1:26380,127.0.0.1:26381,127.0.0.1:26382
// password: Redis连接密码
// db: Redis指定存储库示例1
// sentinelMasterName: Redis 哨兵模式下的服务名称示例mymaster非哨兵模式传入空字符串即可
// minWorkerId: WorkerId 最小值示例30
// maxWorkerId: WorkerId 最大值示例63
// lifeTimeSeconds: WorkerId缓存时长3的倍数推荐值15
extern GoInt32 RegisterOne(char* server, char* password, GoInt32 db, char* sentinelMasterName, GoInt32 minWorkerId, GoInt32 maxWorkerId, GoInt32 lifeTimeSeconds);
// 注销本机已注册的 WorkerId
extern void UnRegister();
// 检查本地WorkerId是否有效0-有效,其它-无效)
extern GoInt32 Validate(GoInt32 workerId);
```
## 已实现的语言